11341 questions

13514 answers


31665 members

0 votes
62 views 0 comments
Working (GET):

sudo curl -X GET ""

Respons: OK

Not working (POST):

sudo curl -X POST ""

Response: Bad username or password

I want to be able to POST the relay to OPEN in 30 sec. The reason for it is that the relay control the power to my computer, and I want to shutdown my computer correctly before the power went out. So I can not have a GET, because then I have to wait.

Regards Terje

Replya minute ago

1 Answer

0 votes


Both GET and POST are used to transfer data, requests from client to server in HTTP, however, there is a difference in how POST and GET requests are represented. GET requests are appended in URL strings. POST request in itself means sending information in the body. It is not possible to send POST parameters in the URL in a straightforward manner. 

You can read more about POST request creation here: https://linuxize.com/post/curl-post-request/.

You can also use Chrome's add-on Postman for testing purposes: https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop

It should also work if you were to simply enter: curl ""

Best regards,