Posted By

igozhenko on 01/29/12


Tagged


Versions (?)

http request


 / Published in: Java
 

create request to Spaxtel service

  1. /**
  2. * Creates the request "https://www.mycallaccount.com/ot/triggerID1.asp".
  3. * Customer didn't provide public API for this service. Used Fiddler2 to
  4. * grab data and emulate request through browser
  5. *
  6. * @param callbackNumber
  7. * callback number
  8. * @return the http post
  9. */
  10. private HttpPost createRequestToMycallaccountSite(String callbackNumber) {
  11. String value = String.format(
  12. "Did=%s&Password=%s&LegBPhone=%s&tempCB=%s&B1=Trigger",
  13. mSettings.getLogin(), mSettings.getPassword(),
  14. Uri.encode(mDialingContact.getNumber()),
  15. Uri.encode(callbackNumber));
  16. HttpPost post = new HttpPost(
  17. "https://www.mycallaccount.com/ot/Di_Trigger_Now31.asp");
  18. ByteArrayEntity entity = new ByteArrayEntity(value.getBytes());
  19. post.addHeader("Content-Type", "application/x-www-form-urlencoded");
  20. post.setEntity(entity);
  21. return post;
  22. }

Report this snippet  

You need to login to post a comment.