Search code examples
httpget

Can HTTP method GET be used with "multipart/form-data" encoding?


I already used HTTP method POST method="post" with encodings:

  • URL encoded ✘: enctype="multipart/form-data"
  • URL encoded ✔: enctype="application/x-www-form-urlencoded"

I also used HTTP method GET method="get" with encoding:

  • URL encoded ✔: enctype="application/x-www-form-urlencoded"

Is it possible to also use method GET with enctype="multipart/form-data"?


Solution

  • No. As GET requests don't have a body, specifying it's Content-Type doesn't make any sense. Especially multipart/form-data, which states the request will have multiple bodies.

    This parameter is only used for request types with bodies, like POST or PUT.