0

This answer suggests that GET request does not support file uploads. Why is this?

So if the endpoint needs to have a file upload, then irrespective of whether it is a read endpoint or write endpoint, we should make it a POST?

variable
  • 8,262
  • 9
  • 95
  • 215

1 Answers1

0

GET requests send data directly as the part of URL - like http://someapi.net/api?key=API_KEY. There are limits in some browsers and web servers that how big an URL can be - and posting a whole file as the part of URL is fairly weird. Yes, you should use POST.

CoderCharmander
  • 1,862
  • 10
  • 18
  • In a GET request, why can't we not upload the file like how we do in POST request via the message body (instead of the url parameter as you mentioned)? – variable Dec 16 '19 at 06:49