Error : Not able to send payload along with params in python post request

Viewed 18

I am trying to send payload along with params to a python post request

payload = json.dumps({
  "number": 1,
  "size": 100,
  "search_status": 4
})

This is the params

params = dict()
params["key"] = key
params["token"] = token

This is the post request line , tried two ways

response_1 = requests.request("POST", base_url, params=params, data=payload)
response_2 = requests.post(base_url, params=params,data=payload)
#print("signature generated sucessfuly")
response_data_1 = response_1.json()
response_data_2 = response_2.json()


print(response_data_1)
print(response_data_2)

When i run the code, it shows error required param number is missing

0 Answers
Related