0

我正在编写 iOS 应用程序。有一个与一些房地产有关的服务器。我必须向服务器发送以下请求以获取 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

我正在使用带有以下代码的 ASI HTTP 进行发布:

[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];   

我得到的响应是
错误:无法启动 HTTP 连接

有人能告诉我如何建立成功的连接吗?

4

1 回答 1

0

我找到了。nonce 值在“响应标头”中返回。

于 2011-12-31T09:12:00.113 回答