Domanda

I'm working with a webserver that works fine on android and browsers only.

On iOS I receive error 500 (internal server error)

Are there any params I should add to the request header?

 (void) weatherWS:(WSManagerDelegate*)delegate withUserId:(NSString*)userId withCurrentLanguage:(NSString*)currentLanguage{

    NSURL *url = [NSURL URLWithString:_urlString];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
    [request setDidFinishSelector:@selector(requestSuccessCallBack:)];
    [request setDidFailSelector:@selector(requestFailedCallBack:)];
    int tag = [self _getRequestTag];
    if (delegate) {
        [_delegatesDictionary setObject:delegate forKey:[NSString stringWithFormat:@"%d",tag]];
    }
    [request setTag:tag];
    [request setRequestMethod:@"GET"];
    [request setTimeOutSeconds:60];
    [request setDelegate:self];
    [request startAsynchronous];

}

the request.responseStatusCode is always 500 (internal sever error)

È stato utile?

Soluzione

well i don't know why but adding [ASIHTTPRequest setSessionCookies:nil]; makes it works!! the weird part is the server did't send any cookies !!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top