Advertisement
sohan_cuet_09

Single textual message to one destination C#

Jun 17th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. var client = new RestClient("http://api.metrotel.com.bd/sms/2/text/single");
  2.  
  3. var request = new RestRequest(Method.POST);
  4. request.AddHeader("accept", "application/json");
  5. request.AddHeader("content-type", "application/json");
  6. request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
  7. request.AddParameter("application/json", "{\"from\":\"8809612316267\", \"to\":\"8801786739367\",\"text\":\"Test SMS.\"}", ParameterType.RequestBody);
  8.  
  9. IRestResponse response = client.Execute(request);
  10.  
  11. // Here QWxhZGRpbjpvcGVuIHNlc2FtZQ== resemble base_64 encode of username:password
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement