Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support uploading images via PUT request #18

Closed
kylef opened this issue Jun 21, 2021 · 0 comments
Closed

Support uploading images via PUT request #18

kylef opened this issue Jun 21, 2021 · 0 comments

Comments

@kylef
Copy link

kylef commented Jun 21, 2021

HTTP PUT is a common format which other services support (such as https://transfer.sh). It would be awesome to add support for cross-service compatibility. This is simple to use with standard tools like curl, for example:

$ curl --upload-file ~/Screenshots/2021-06-19_14-18-33.png https://img.vim-cn.com/

The service appears to return a stacktrace in this case:

$ curl --upload-file ~/Screenshots/2021-06-19_14-18-33.png https://img.vim-cn.com/

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/tornado/web.py", line 1569, in _execute
    result = self.prepare()
  File "/usr/lib/python3/dist-packages/tornado/web.py", line 2322, in prepare
    raise HTTPError(self._status_code)
tornado.web.HTTPError: HTTP 404: Not Found

This would work something like:

PUT /file.png HTTP/1.1
Host: img.vim-cn.com
Content-Type: image/png

<the contents of the PNG>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant