Doing a HTTP DELETE operation with urllib2?

Discussion in 'Python' started by Roy Smith, Dec 30, 2011.

  1. Roy Smith

    Roy Smith Guest

    Is there some way to make urllib2.urlopen() perform a DELETE instead of a GET or POST?

    I'm hoping I don't have to dip way down into httplib. I've got an application test framework built on top of urllib2. It makes heavy use of HTTPCookieProcessor. If I need to use the httplib calls directly, I'll have to re-implement a lot of that machinery.
     
    Roy Smith, Dec 30, 2011
    #1
    1. Advertising

  2. Roy Smith

    Roy Smith Guest

    Ah, cool. I didn't know you could do that. Thanks.
     
    Roy Smith, Dec 30, 2011
    #2
    1. Advertising

  3. Roy Smith

    Roy Smith Guest

    Ah, cool. I didn't know you could do that. Thanks.
     
    Roy Smith, Dec 30, 2011
    #3
  4. Hi,

    On 12/30/2011 12:01 PM, Roy Smith wrote:
    > Is there some way to make urllib2.urlopen() perform a DELETE instead of a GET or POST?
    >
    > I'm hoping I don't have to dip way down into httplib. I've got an application test framework built on top of urllib2. It makes heavy use of HTTPCookieProcessor. If I need to use the httplib calls directly, I'll have to re-implement a lot of that machinery.

    You might want to look:
    https://github.com/dougsland/rhev3-restapi-scripts/blob/master/sample-delete.py

    --
    Cheers
    Douglas
     
    Douglas Landgraf, Dec 30, 2011
    #4
  5. On Fri, 30 Dec 2011 10:57:06 -0800, Roy Smith wrote:

    > Ah, cool. I didn't know you could do that. Thanks.


    Who are you talking to, and what is "that"?

    Replies with no context are somewhat less than useful. It might have made
    sense in your head when you wrote the reply, but to those reading, it is
    rather cryptic.


    --
    Steven
     
    Steven D'Aprano, Dec 30, 2011
    #5
  6. Roy Smith

    Dave Angel Guest

    On 12/30/2011 03:37 PM, Steven D'Aprano wrote:
    > On Fri, 30 Dec 2011 10:57:06 -0800, Roy Smith wrote:
    >
    >> Ah, cool. I didn't know you could do that. Thanks.

    > Who are you talking to, and what is "that"?
    >
    > Replies with no context are somewhat less than useful. It might have made
    > sense in your head when you wrote the reply, but to those reading, it is
    > rather cryptic.
    >
    >

    Actually I think he was replying to Roy Smith's message, which has a
    timestamp of 77 minutes later. Interesting the effects you get when
    some clocks are allowed to drift.



    --

    DaveA
     
    Dave Angel, Dec 30, 2011
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Josef Cihal
    Replies:
    0
    Views:
    872
    Josef Cihal
    Sep 5, 2005
  2. david ullua
    Replies:
    13
    Views:
    689
  3. tom
    Replies:
    5
    Views:
    429
  4. raan
    Replies:
    2
    Views:
    470
  5. Greg Hauptmann
    Replies:
    1
    Views:
    178
    Tony Arcieri
    Dec 8, 2009
Loading...

Share This Page