I want to send a simple message using the service Clickatell.
I don't want to read the response, it will be simple GET request to send a message.
The service provides the request looks like:
https://platform.clickatell.com/messages/http/send?apiKey=xxxxxxxxxxxxxxxx==&to=xxxxxxxxxxx&content=Test+message+text
I checked it with curl
curl "https://platform.clickatell.com/messages/http/send?apiKey=apiKEY==&to=NUMBER&content=Test+message+text"
and it's working really fine.
I try to use it with my Windows Forms application with HTTP request Below is the code which I provided:
var client2 = new HttpClient();
client2.GetAsync("https://platform.clickatell.com/messages/http/send?apiKey=apiKEY==&to=NUMBER&content=Test+message+text");
App.Write("SMS SEND!");
I have info that SMS send, but I didn't receive it. My friend use my code in the .NET application and it's working for him.
Do I miss something?
Maybe it's really worth to mention I need to add to References manually using System.Net.Http;
EDIT:
I tried to add to do it async, so I edit my code to:
static void sendSMS()
{
var client2 = new HttpClient();
var task = client2.GetAsync("https://platform.clickatell.com/messages/http/send?apiKey=API_KEY==&to=MY_NUMBER&content=Test+message+text");
task.Wait();
App.Write("SMS SEND!");
}
But now the SMS SEND message in the application is not shown.