문제

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?

도움이 되었습니까?

해결책

I found it. The nonce value is being returned in "Response Header".

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top