Skip to content

DELETE redirect not supported [urllib.request] #124857

@Jean-Luc-Picard-2021

Description

@Jean-Luc-Picard-2021

Bug description:

Compare node.js:

> response = await fetch('http://www.xlog.ch/echo/delete?foo1=bar1&foo2=bar2',
...  {method:'DELETE'}); response.url
'https://www.xlog.ch/echo/delete?foo1=bar1&foo2=bar2'

With CPython:

request = urllib.request.Request('http://www.xlog.ch/echo/delete?foo1=bar1&foo2=bar2', method='DELETE')
response = urllib.request.urlopen(request)
urllib.error.HTTPError: HTTP Error 302:

I believe node.js fetch() redirects, whereas CPython thinks
302 is an error, since the method is neither HEAD, GET or PUT.

But its probably not an error, all methods are allowed:

image
https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions