bartosz
bartosz

Reputation: 414

How to match payload in POST request

I've got a GET request like this:

<FORM action='vieweto0.php' method='POST'>
  <SELECT name='ID_Profil'>
    <OPTION value=3> blank3</OPTION>
    <OPTION value=2> blank2</OPTION>
    <OPTION value=4>blank4</OPTION>
  </SELECT>
  <br><input type='submit' type=hidden name='OK' value='choose this one'>
</FORM>

How my POST request should look like if I want to choose OPTION 'blank4'?

Where I can read more about POST request like this?

Upvotes: 0

Views: 171

Answers (2)

Huang
Huang

Reputation: 609

If you use python requests:

import requests
res = requests.post("http://hostaddress/vieweto0.php", data={"ID_Profil":4})

POST or GET requests are basically sending key-value pairs to the server.

Learn more about http POST on https://www.w3schools.com/html/default.asp and how requests work on this: http://docs.python-requests.org/en/master/user/quickstart/. If you are interested in the details of POST, you can read this: https://www.rfc-editor.org/rfc/rfc7231#section-4.3.3.

Upvotes: 1

Youssef Saoubou
Youssef Saoubou

Reputation: 591

You can use this $_POST['ID_Profil'];

Upvotes: 1

Related Questions