Question: I'm new to objective-c and I'm starting to put a great deal of effort into request/response as of recent. I have a working example that can call a url (via http GET) and parse the json returned.

The working example of this is below

```
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
    [responseData setLength:0];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
    [responseData appendData:data];
}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
  NSLog([NSString stringWithFormat:@"Connection failed: %@", [error description]]);
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
    [connection release];
  //do something with the json that comes back ... (the fun part)
}

- (void)viewDidLoad
{
  [self searchForStuff:@"iPhone"];
}

-(void)searchForStuff:(NSString *)text
{
  responseData = [[NSMutableData data] retain];
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.whatever.com/json"]];
    [[NSURLConnection alloc] initWithRequest:request delegate:self];
}

```

My first question is - will this approach scale up? Or is this not async (meaning I block the UI thread while the app is waiting for the response)

My second question is - how might I modify the request part of this to do a POST instead of GET? Is it simply to modify the HttpMethod like so?

```
[request setHTTPMethod:@"POST"];

```

And finally - how do I add a set of json data to this post as a simple string (for example)

```
{
    "magic":{
               "real":true
            },
    "options":{
               "happy":true,
                "joy":true,
                "joy2":true
              },
    "key":"123"
}

```

Thank you in advance

Answer: 
I would suggest to use [ASIHTTPRequest](http://allseeing-i.com/ASIHTTPRequest/How-to-use)

> 
> ASIHTTPRequest is an easy to use
>  wrapper around the CFNetwork API that
>  makes some of the more tedious aspects
>  of communicating with web servers
>  easier. It is written in Objective-C
>  and works in both Mac OS X and iPhone
>  applications.
> 
> 
> It is suitable performing basic HTTP
>  requests and interacting with
>  REST-based services (GET / POST / PUT
>  / DELETE). The included
>  ASIFormDataRequest subclass makes it
>  easy to submit POST data and files
>  using multipart/form-data.
> 
> 
> 

---

Please note, that the original author discontinued with this project. See the followring post for reasons and alternatives: <http://allseeing-i.com/%5Brequest_release%5D>;

Personally I am a big fan of [AFNetworking](https://github.com/AFNetworking/AFNetworking/)
> 
> You can try this code for send json string
> 
> 
> 

```
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:ARRAY_CONTAIN_JSON_STRING options:NSJSONWritin*emphasized text*gPrettyPrinted error:NULL];
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSString *WS_test = [NSString stringWithFormat:@"www.test.com?xyz.php&param=%@",jsonString];

```