views:

16

answers:

1

Hey,

I'm using the ASIHTTPRequest library to authenticate with Google Voice. I get as far as getting the auth code but when I try to get send the auth token in the headers, it still takes me back to the login page.

ASIHTTPRequest *rnrRequest = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"https://www.google.com/voice/"]];
        [rnrRequest addRequestHeader:@"Authorization:" value:[NSString stringWithFormat:@"GoogleLogin auth=%@", mainDelegate.authToken]];
        [rnrRequest startSynchronous];

        NSLog([rnrRequest responseString]);

I don't know what to do. Can anyone help?

Thanks in advance!

A: 

try using "Authorization" instead of "Authorization:" (note the missing colon)

this code works for me:

- (ASIHTTPRequest *) requestForAPIEndpoint: (NSString *) apiEndpoint
{
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString: apiEndpoint]];
    [request addRequestHeader: @"Authorization" value: [NSString stringWithFormat: @"GoogleLogin auth=%@", [self token]];

    return request;
}
Jaroslaw Szpilewski
That doesn't seem to work either. I'm trying to get the _rnr_se code. Do you know a different way?
Dro Sarhadian