setHTTPMethod: with PUT and DELETE methods

  • I've searched the archives and have seen how PUT doesn't work with
    NSMutableURLRequest. That was  awhile ago. Is that still the case?
    I'm also interested in if the DELETE method works.
  • On Oct 10, 2007, at 8:26 PM, Rod Schmidt wrote:

    > I've searched the archives and have seen how PUT doesn't work with
    > NSMutableURLRequest. That was  awhile ago. Is that still the case?
    > I'm also interested in if the DELETE method works.

    NSURLRequest only supports HTTP GET and POST. If you need to do
    WebDAV-style operations, then you'll need to use a different library.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • On 11 Oct 2007, at 04:04, Nick Zitzmann wrote:

    >
    > On Oct 10, 2007, at 8:26 PM, Rod Schmidt wrote:
    >
    >> I've searched the archives and have seen how PUT doesn't work with
    >> NSMutableURLRequest. That was  awhile ago. Is that still the case?
    >> I'm also interested in if the DELETE method works.
    >
    > NSURLRequest only supports HTTP GET and POST. If you need to do
    > WebDAV-style operations, then you'll need to use a different library.
    >

    PUT & DELETE seem to be working fine for us on 10.4.10.  In what
    respect don't they work?
  • As well as "custom" ones like MKCALENDAR, PROPPATCH & PROPFIND for
    webdav/caldav work. (since 10.4.10)

    On Oct 11, 2007, at 9:07 AM, Jonathan del Strother wrote:

    >
    > On 11 Oct 2007, at 04:04, Nick Zitzmann wrote:
    >
    >>
    >> On Oct 10, 2007, at 8:26 PM, Rod Schmidt wrote:
    >>
    >>> I've searched the archives and have seen how PUT doesn't work
    >>> with NSMutableURLRequest. That was  awhile ago. Is that still the
    >>> case? I'm also interested in if the DELETE method works.
    >>
    >> NSURLRequest only supports HTTP GET and POST. If you need to do
    >> WebDAV-style operations, then you'll need to use a different library.
    >>
    >
    > PUT & DELETE seem to be working fine for us on 10.4.10.  In what
    > respect don't they work?
  • In the PUT case I get back a 405 error, which is resource not
    allowed. In the DELETE case, I get a 200 back which means OK, but the
    server didn't actually do anything. I'm interacting with 37signals'
    Backpack API. At this point I'm thinking its 37signals' problem, but
    from what I saw in the archive, I'm not sure NSMutableURLRequest
    works with these commands.

    Rod

    On Oct 11, 2007, at 7:07 AM, Jonathan del Strother wrote:

    >
    > On 11 Oct 2007, at 04:04, Nick Zitzmann wrote:
    >
    >>
    >> On Oct 10, 2007, at 8:26 PM, Rod Schmidt wrote:
    >>
    >>> I've searched the archives and have seen how PUT doesn't work
    >>> with NSMutableURLRequest. That was  awhile ago. Is that still the
    >>> case? I'm also interested in if the DELETE method works.
    >>
    >> NSURLRequest only supports HTTP GET and POST. If you need to do
    >> WebDAV-style operations, then you'll need to use a different library.
    >>
    >
    > PUT & DELETE seem to be working fine for us on 10.4.10.  In what
    > respect don't they work?
  • 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

    On 11 Oct 2007, at 16:04, Rod Schmidt wrote:

    > In the PUT case I get back a 405 error, which is resource not
    > allowed. In the DELETE case, I get a 200 back which means OK, but
    > the server didn't actually do anything. I'm interacting with
    > 37signals' Backpack API. At this point I'm thinking its 37signals'
    > problem, but from what I saw in the archive, I'm not sure
    > NSMutableURLRequest works with these commands.
    >
    > Rod
    >
    > On Oct 11, 2007, at 7:07 AM, Jonathan del Strother wrote:
    >
    >>
    >> On 11 Oct 2007, at 04:04, Nick Zitzmann wrote:
    >>
    >>>
    >>> On Oct 10, 2007, at 8:26 PM, Rod Schmidt wrote:
    >>>
    >>>> I've searched the archives and have seen how PUT doesn't work
    >>>> with NSMutableURLRequest. That was  awhile ago. Is that still the
    >>>> case? I'm also interested in if the DELETE method works.
    >>>
    >>> NSURLRequest only supports HTTP GET and POST. If you need to do
    >>> WebDAV-style operations, then you'll need to use a different
    >>> library.
    >>>
    >>
    >> PUT & DELETE seem to be working fine for us on 10.4.10.  In what
    >> respect don't they work?
    >
  • 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
    >
    >
    >
    > On 11 Oct 2007, at 16:04, Rod Schmidt wrote:

    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.

    Rod
  • Look in your web server logs (httpd) - that will tell you whether the
    request method is being made - and I'm sure it is.
    The error returned, is from the web server - and that's a different
    problem then whether the client request supports other methods then
    GET/POST, which it does.

    On Oct 11, 2007, at 11:04 AM, Rod Schmidt wrote:

    > In the PUT case I get back a 405 error, which is resource not
    > allowed. In the DELETE case, I get a 200 back which means OK, but
    > the server didn't actually do anything. I'm interacting with
    > 37signals' Backpack API. At this point I'm thinking its 37signals'
    > problem, but from what I saw in the archive, I'm not sure
    > NSMutableURLRequest works with these commands.
    >
    > Rod
    >
    > On Oct 11, 2007, at 7:07 AM, Jonathan del Strother wrote:
    >
    >>
    >> On 11 Oct 2007, at 04:04, Nick Zitzmann wrote:
    >>
    >>>
    >>> On Oct 10, 2007, at 8:26 PM, Rod Schmidt wrote:
    >>>
    >>>> I've searched the archives and have seen how PUT doesn't work
    >>>> with NSMutableURLRequest. That was  awhile ago. Is that still
    >>>> the case? I'm also interested in if the DELETE method works.
    >>>
    >>> NSURLRequest only supports HTTP GET and POST. If you need to do
    >>> WebDAV-style operations, then you'll need to use a different
    >>> library.
    >>>
    >>
    >> PUT & DELETE seem to be working fine for us on 10.4.10.  In what
    >> respect don't they work?

  • 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.
  • 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.
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today