Benches Networking

1

kCFErrorDomainCFNetwork 303 Operation could not...

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hey,

I got a problem with NSMutableURLRequest/Response.

I try to send some data to a webserver, which is prepared to receive and process the data. It sends some data back afterwards. So I am trying to send an HTTP POST Request to a Servlet on an application server. It works fine with HTTP GET Requests, but not with POST.


- (void) writeXML:(NSData*)data toUrl:(NSString*)urlStr {

NSURL* url = [[NSURL alloc] initWithString:urlStr];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];

[request setHTTPBody:data];
NSLog(@"REQUEST: %@", [request HTTPBody]);

NSURLResponse* response = nil;
NSError *error = nil;

NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];

if ([error code]) {
NSLog(@"%@ %d %@", [error domain], [error code], [error localizedDescription]);
}

NSLog(@"RESPONSE: %@", responseData);
}

After sending the request my error object has the Error code 303: "kCFErrorDomainCFNetwork 303 Operation could not be completed".

I could not find anything about this error message, which is useful. Maybe an explanation about this error might be helpful for me.

Regards,
Felix

Message was edited by: Floix

Message was edited by: Floix

1 reply

Sign in or join Beachball Help to reply.

  1. 0

    Apple Support Community member

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Got it. Just had to set the HTTPMethod to "POST"

    Message was edited by: Floix