We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NSString* query = @"{\"number\":3154478103,\"message\":\"Test\"}";
NSLog(@"SMS send request Query : %@",query); NSString *post = [NSString stringWithFormat:@"%@",query]; NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding ]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; NSString *url = @"http://textbelt.com/text/";
[request setURL:[NSURL URLWithString:url]]; [request setHTTPMethod:METHOD_POST]; [request setHTTPBody:postData]; NSLog(@"Sending the SMS to the user "); //creating the session to get the json response NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]]; [[session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { NSString* jsonResponse = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; NSLog(@"This is Asynchronous Response : %@",jsonResponse); }] resume];
The text was updated successfully, but these errors were encountered:
You need to POST this as normal HTTP parameters, not a JSON object. The POST body should probably look like number=XXXX&message=Test.
Sorry, something went wrong.
Possibly related as well is issue #45
Thank you so much !!! It worked !!!!
No branches or pull requests
NSLog(@"SMS send request Query : %@",query);
NSString *post = [NSString stringWithFormat:@"%@",query];
NSData *postData = [post dataUsingEncoding:NSUTF8StringEncoding ];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
NSString *url = @"http://textbelt.com/text/";
The text was updated successfully, but these errors were encountered: