iOS - NSURLConnection - Connecting to server and get Nonce
- by Satyam svv
I'm writing iOS application.
There's a server related to some real estate.
I've to send the following request to server to get the Nonce.
GET /ptest/login HTTP/1.1
Method: GET
User-Agent: MRIS API
Testing Tool/2.0
Rets-Version: RETS/1.7
Accept: */*
Host: ptest.mris.com:6103
Connection: keep-alive
I'm using ASI HTTP with following code to post:
[self setRequest:[ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"/ptest/login"]]];
[request addRequestHeader:@"User-Agent" value:@"CARETS-General/1.0"];
[request addRequestHeader:@"Rets-Version" value:@"1.7"];
[request addRequestHeader:@"Connection" value:@"keep-alive"];
[request addRequestHeader:@"Accept" value:@"*/*"];
[request addRequestHeader:@"Host" value:"ptest.mris.com:6103"];
[request setDelegate:self];
[request setDidFinishSelector:@selector(topSecretFetchComplete:)];
[request setDidFailSelector:@selector(topSecretFetchFailed:)];
[request startAsynchronous];
The response that I'm getting is
Error: Unable to start HTTP connection
Can some one point me how to establish successful connection?