Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Retrieving response sent by the sms service?  RSS feed

 
Lila Fowler
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am sending a sms via Clickatell using the HttpURLConnection method in java.
Although the message sends fine, I cannot seem to get the message returned by Clickatell.

The way it works without java is I paste the url into the browser and on the browser window
either a message id appears or an error message appears. (I have included screen shots of both.)

I am looking for a way to retrieve the error/success message that clickatell returns in the screen shots.

Here is the main snippet of the current code:



I have tried get and post but this simply returned a null value.
Either I am using these methods wrong, or because the actual
URL does not change the to include the value, the value cannot
be picked up by these methods.

Any ideas what I need to do differently or how to get the results?

Thanks for the help.
clickatellmessageid.jpg
[Thumbnail for clickatellmessageid.jpg]
Returned Success Message
clickatellerrormessage.jpg
[Thumbnail for clickatellerrormessage.jpg]
Returned Error Message
 
Lila Fowler
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys,

Managed to sort it out using an Input Stream instead

 
Anurag Verma
Ranch Hand
Posts: 170
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly, you were missing reading of response in your code.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!