• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setHTTPMethod: with PUT and DELETE methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >setHTTPMethod: with PUT and DELETE methods (From: Rod Schmidt <email@hidden>)
 >Re: setHTTPMethod: with PUT and DELETE methods (From: Nick Zitzmann <email@hidden>)
 >Re: setHTTPMethod: with PUT and DELETE methods (From: Jonathan del Strother <email@hidden>)
 >Re: setHTTPMethod: with PUT and DELETE methods (From: Rod Schmidt <email@hidden>)
 >Re: setHTTPMethod: with PUT and DELETE methods (From: Jonathan del Strother <email@hidden>)
 >Re: setHTTPMethod: with PUT and DELETE methods (From: Rod Schmidt <email@hidden>)
 >Re: setHTTPMethod: with PUT and DELETE methods (From: Jonathan del Strother <email@hidden>)

  • Prev by Date: Re: setHTTPMethod: with PUT and DELETE methods
  • Next by Date: Re: NSOpenPanel & NSFileTypeForHFSTypeCode
  • Previous by thread: Re: setHTTPMethod: with PUT and DELETE methods
  • Next by thread: Re: setHTTPMethod: with PUT and DELETE methods
  • Index(es):
    • Date
    • Thread