Guest User

Untitled

a guest
Jun 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. public confirmationStatus Send(string phoneNumber, string text)
  2. {
  3.  
  4. messages_send model = new messages_send() { contacts = new List<string>() { phoneNumber }, text=text };
  5. string url = this.setupUrl();
  6. string dataToSend = new JavaScriptSerializer().Serialize(model);
  7.  
  8. var cli = new WebClient();
  9. cli.Headers[HttpRequestHeader.ContentType] = "application/json";
  10. string response = cli.UploadString(url, dataToSend);
  11.  
  12. return new JavaScriptSerializer().Deserialize<confirmationStatus>(response);
  13.  
  14. }
  15.  
  16. POST https://api.***.com/v1/messages? HTTP/1.1
  17. Content-Type: application/json
  18. Host: api.**.com
  19. Content-Length: 1061
  20. Expect: 100-continue
  21. Connection: Keep-Alive
  22.  
  23. {"contacts":["+1*****9"],"text":"**??HME??????** John,??? 01-01-0001 ???? 12:00 AM ? 12:00 AM? ????????????????????: Link: https://www.****.com/timesheets/?v=0 .Text STOP "}
Add Comment
Please, Sign In to add comment