开发者

How to obtain headers from TTURLResponse (Specifically, TTURLJSONResponse)

I can't find anything about headers in three20 documentation:

开发者_如何学编程

http://api.three20.info/interface_t_t_u_r_l_j_s_o_n_response.php http://api.three20.info/protocol_t_t_u_r_l_response-p.php

I see something about the headers in TTURLRequest:

http://api.three20.info/interface_t_t_u_r_l_request.php

Although I can't access those headers - they return nil. (Also - I want the response headers, not the request headers).

So how do I access the response headers from a TTURLJSONRequest?


Subclass TTURLJSONResponse, and implement

- (NSError*)request:(TTURLRequest*)request processResponse:(NSHTTPURLResponse*)response data:(id)data {
    // do your stuff with response - with the dictionary [response allHeaderFields];
    return [super request:request processResponse:response data:data];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜