HTTP PUT Request Limit

I am developing a RESTful API when I notice something strange.

When I make a POST request to create a new record, the form data is sent in the request payload.

But when I make a PUT request to update the record, it adds the form data to the URL, very similar to the GET request.

URL now has a certain length limit. So what happens if a PUT request has more data than this limit.

Will the PUT request fail?

Is it unsafe to use PUT instead of POST to update a record with large data forms?

EDIT: I am using a NodeJS server. I am using restangular (angular framework) to create my PUT request.

+4
source share
2 answers

Use customPUT to submit form data in a payload.

baseObj.customPUT(newObj).then(function(xyz){})
+2
source

Look at these streams

It looks like you can set the title Content-type: multipart/form-dataand become gold. It basically comes down to configuring the query with the relational module and its support on the NodeJS server.

+1
source

Source: https://habr.com/ru/post/1546419/


All Articles