How does requests pass parameters to body

this body is in the form of form-data, but it"s not a dictionary, it"s 123 meme 11-22-33: this form. First of all, I don"t know what the following ";:" means. Secondly, I want to pass the parameters to body. It is also wrong to write body= {"{id}, {code};:"}. In postman, I set key to empty and I can return correctly. Do I need to write a dictionary format in python?

Oct.28,2021

Click here in Postman to automatically generate code.
clipboard.png


generally speaking, if you send json data to the server, and the request header is set to "Content-Type": "application/json" , you can use request.body to obtain the information on the server side. If you need to obtain the information, you can test and verify the request header on django or a simple wsgi web server written by yourself
request header as follows

.
  

maybe I can't describe clearly, but anyway, has been solved. Set
body = f'{id}, {code};:'
then response = requests.post (url=url, data=body, headers=headers)

Menu