Imagine you are implementing a feature to upload a file to the server. Which HTTP method would be most appropriate to use with the Fetch API for this purpose?

  • GET
  • POST
  • PUT
  • DELETE
To upload a file to the server, you would use the POST HTTP method with the Fetch API. The POST method is used for submitting data to be processed to a specified resource, which is suitable for file uploads. GET, PUT, and DELETE have different purposes.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *