[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Access HTTP DELETE method using LIBHTTP



   That is it Mick!!. Thank you very much for pointing me the correct
   direction
   rc = http_persist_req( 'DELETE' : t_pointer : uri : 0 : *null: *null: 0
   : 60 : *null);

   rc = http_persist_req( 'PUT' : t_pointer : uri : 0 : *NULL :
   %addr(input) +2 : %len(input)  : 8 : *NULL  : 300 : *omit :
   'application/xml');
   now I'm using above pr to access PUT/DELETE methods and it works fine..
   (Both PUT/DELETE methods in server side are returning nothing - void
   methods :) )
   and then I have changed the server side PUT method to return some kinda
   xml stuff and change pr to have call-back procedure but cause to throw
   an error
   rc = http_persist_req( 'PUT' : t_pointer : uri : 0 : *NULL :
   %addr(input) +2 : %len(input)  : 8 : %paddr(getXml) : 300 : *omit :
   'application/xml');

   I think I should write a pr similar to http_url_post_xml() and inside
   that call http_persist_req(),  -- may be http_url_put_xml()    :)
   I guess I can handle it.
   Thanks again...
   Dhanushka

   On Fri, Apr 19, 2013 at 12:33 AM, Mike Krebs
   <[1]mkrebs@xxxxxxxxxxxxxxxxxx> wrote:

     I don't think Scott implemented DELETE as a standalone procedure
     although it is talked about in this thread
     ([2]http://www.scottklement.com/archives/ftpapi/201206/msg00015.html
     ) using http_persist_req.
     Version 1.24
       - BETA15: Added http_persist_req() as a method of invoking
                 any HTTP method (not limited to GET/POST). It's
                 expected that an http_req() procedure will be added
                 in next release that will utilize this.
     So you can call http_persist_req to do a DELETE
     http_persist_req(): Perform (any) Persistent HTTP Request
          peMethod = (input) Operation to perform. Should be one of:
                             'GET', 'DELETE', 'PUT', 'POST', 'HEAD'
            peComm = (input) pointer to persistent HTTP comm session
             peURL = (input) URL of resource to perform operation on
     Looking quick, I couldn't find an example of using the
     http_persist_xxxx procedures.
     I think you need to:
     http_persist_open
     http_persist_req
     http_persist_close
     Okay, I looked one more time and here it is!
     [3]http://www.scottklement.com/archives/ftpapi/201202/msg00040.html

   -----Original Message-----
   From: [4]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   [mailto:[5]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
   Dhanushka Manjula
   Sent: Thursday, April 18, 2013 12:28 AM
   To: HTTPAPI and FTPAPI Projects
   Subject: Access HTTP DELETE method using LIBHTTP
   Hi all,
   Both GET & DELETE methods of restful webservice is using same URL
   pattern
   but doing different operation based on http access methods (GET /
   DELETE )
   The URL pattern for both operation is similar to this..
   http:...../rest/categoryservice/category/001/
   I could access the GET using http_url_get_xml and do what i want.
   but what method should I use to access DELETE method ?
   Thanks
   Dhanushka

     --------------------------------------------------------------------
     ---
     This is the FTPAPI mailing list.  To unsubscribe, please go to:
     [6]http://www.scottklement.com/mailman/listinfo/ftpapi
     --------------------------------------------------------------------
     ---

References

   1. mailto:mkrebs@xxxxxxxxxxxxxxxxxx
   2. http://www.scottklement.com/archives/ftpapi/201206/msg00015.html
   3. http://www.scottklement.com/archives/ftpapi/201202/msg00040.html
   4. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   5. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   6. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------