Developer Area

Changeset 765

Show
Ignore:
Timestamp:
01/10/11 13:58:59 (3 years ago)
Author:
henri
Message:

Added localization of JSON requests via Accept-Language HTTP header

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/my.tel/trunk/Classes/API Classes/JsonConnection.m

    r702 r765  
    104104        [urlReq setHTTPMethod:@"POST"]; 
    105105    [urlReq setValue:@"application/json; charset=UTF-8" forHTTPHeaderField:@"Content-Type"]; 
     106    [urlReq setValue:[[NSLocale preferredLanguages] objectAtIndex:0] forHTTPHeaderField:@"Accept-Language"]; 
    106107         
    107108        NSDictionary *bodyDict = [NSDictionary dictionaryWithObjectsAndKeys: 
     
    115116         
    116117#ifdef JSONDEBUG 
     118        NSLog(@"Query Headers: %@",[[urlReq allHTTPHeaderFields] description]); 
    117119        NSLog(@"Body Representation: %@",[bodyDict JSONRepresentation]); 
    118120#endif 
     
    203205#ifdef JSONDEBUG 
    204206        NSLog(@"Connection is: %@", [connection description]); 
    205 //    NSLog(@"Response payload: %@", responsePayload); 
     207    NSLog(@"Response payload: %@", responsePayload); 
    206208#endif 
    207209    [self parsePayload]; 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us