GithubHelp home page GithubHelp logo

Comments (7)

moy avatar moy commented on May 14, 2024 4

It would be nice to have an <input type="file"> on http://httpbin.org/forms/post, so that we can easily test the file upload from a form.

from httpbin.

kevin1024 avatar kevin1024 commented on May 14, 2024 1

You can actually upload files to the /post endpoint. The file will show up under the "files" attribute, and you can call len() on that to get the size.

$ curl -F [email protected] http://httpbin.org/post
{
  "args": {},
  "data": "",
  "files": {
    "filedata": "test file\n"
  },
  "form": {},
  "headers": {
    "Accept": "*/*",
    "Connection": "close",
    "Content-Length": "204",
    "Content-Type": "multipart/form-data; boundary=----------------------------6f3090fec3a4",
    "Host": "httpbin.org",
    "User-Agent": "curl/7.30.0",
    "X-Request-Id": "a6a6fbb4-a8aa-4d60-8918-c3591ea2ab35"
  },
  "json": null,
  "origin": "198.15.98.58",
  "url": "http://httpbin.org/post"

That said, we could make this friendlier possibly. @kennethreitz can you weigh in on this?

from httpbin.

nishanov avatar nishanov commented on May 14, 2024

Hi there. Any progress here?

from httpbin.

sigmavirus24 avatar sigmavirus24 commented on May 14, 2024

Since this already exists, I'm inclined to close this unless there is some further clarification on why this needs to differ from /post.

from httpbin.

kennethreitz avatar kennethreitz commented on May 14, 2024

This is indeed what /post was intended for.

from httpbin.

iBasit avatar iBasit commented on May 14, 2024

no test upload?

from httpbin.

CMCDragonkai avatar CMCDragonkai commented on May 14, 2024

This assumes that the upload content type is a standard multipart/form-data or application/x-www-form-urlencoded. What if you are trying to upload all sorts of stuff like application/x-tar... etc?

from httpbin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.