Y
Y
yosiaproger2021-03-18 18:27:25
PHP
yosiaproger, 2021-03-18 18:27:25

How to send form data using PATCH method?

Understanding REST API. With the GET method, everything is clear, we write in the browser line, for example, posts/8, we throw out the post to the browser with id=8. I don't understand how to use PATCH, PUT, DELETE methods. I don’t understand how, for example, to send data for editing through the PATCH method through php, because in the same form I can specify only 2 get or post methods. And what is the purpose of the POST method in REST in this case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2021-03-18
@yosiaproger

curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PATCH'); should do it.
Just don't use forms. Form a request manually

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question