How to make a post request with the Python requests library?

前端 未结 4 1597
别跟我提以往
别跟我提以往 2020-12-29 12:12

I am using the following filters in Postman to make a POST request in a Web API but I am unable to make a simple POST request in Python with the requests library.

<

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 12:13

    I think, you can use requests library as follows:

    import requests
    import json
    
    payload = {'field':'T_Subcategory','operator':'neq','value':'Temporary Degradation'}
    url = requests.post("http://10.61.202.98:8081/T/a/api/rows/cat/ect/tickets",data=json.dumps(payload))
    

提交回复
热议问题