smtlaissezfaire
smtlaissezfaire

Reputation: 436

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?

Upvotes: 0

Views: 302

Answers (1)

tsakoyan
tsakoyan

Reputation: 1891

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

Upvotes: 1

Related Questions