Re: setHTTPMethod: with PUT and DELETE methods
Re: setHTTPMethod: with PUT and DELETE methods
- Subject: Re: setHTTPMethod: with PUT and DELETE methods
- From: Tony Becker <email@hidden>
- Date: Thu, 11 Oct 2007 12:00:07 -0400
Code sniglet:
NSMutableURLRequest *proppatchURLRequest = [NSMutableURLRequest
requestWithURL:[NSURL URLWithString:str]
cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];
[proppatchURLRequest setHTTPMethod:@"PROPPATCH"];
[proppatchURLRequest setValue:@"application/xml"
forHTTPHeaderField:@"Content-type"];
NSXMLElement *rootElement = [[NSXMLElement alloc]
initWithName:@"D:propertyupdate"];
NSXMLDocument *xmlDoc = [[NSXMLDocument alloc]
initWithRootElement:rootElement];
[xmlDoc setCharacterEncoding:@"US-ASCII"];
... XML doc
NSData *body = [xmlDoc XMLDataWithOptions:NSXMLDocumentTidyHTML];
[proppatchURLRequest setHTTPBody:body];
[NSURLConnection connectionWithRequest:proppatchURLRequest
delegate:self];
On Oct 11, 2007, at 11:56 AM, Jonathan del Strother wrote:
On 11 Oct 2007, at 16:48, Rod Schmidt wrote:
On Oct 11, 2007, at 9:41 AM, Jonathan del Strother wrote:
We're using our own rails REST-based api, and NSMutableURLRequest
works fine for it. I suspect it's a problem with the Backpack
API, or the way you're interacting with it
Is there anything special you have to do like set the content-
length or some other header? Everything looks good as far as I can
tell.
I set the content type and accept fields to application/xml, that's
about it.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden