KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to send my JSON to a URL ( POST and GET ). NSMutableDictionary *JSONDict = [[NSMutableDictionary alloc] init]; [JSONDict setValue:"myValue" forKey:"myKey"]; NSData *JSONData = [NSJSONSerialization dataWithJSONObject:self options:kNilOptions error:nil]; My current request code isn't working. NSMutableURLRequest *requestData = [[NSMutableURLRequest alloc] init]; [requestData setURL:[NSURL URLWithString:@"http://fake.url/"];]; [requestData setHTTPMethod:@"POST"]; [requestData setValue:postLength forHTTPHeaderField:@"Content-Length"]; [requestData setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; [requestData setValue:@"application/json" forHTTPHeaderField:@"Accept"]; [requestData setHTTPBody:postData]; Using ASIHTTPRequest is not a liable answer.
Tags (comma-separated)
Save Edits
Cancel