Home python I can not execute POST request Python Requests

I can not execute POST request Python Requests

Author

Date

Category

gives out such an error:

& gt; {"message": "Query Must Be Present"}
& GT; & GT; {"Message": "Request Must Be In JSon Format"}
& GT; & GT; {"Message": "Request Must Be In JSon Format"}

and water the same code from the documentation works

POAD = {'UserName': 'Olivia', 'Password': '123'}
Print (Requests.post ('https://httpbin.org/post'/data = pozzle) .text)

Answer 1, Authority 100%

It seems to documentation it is written that (for your code ) It is necessary to call like this:

requests.post (link, data = headers)

Answer 2, Authority 50%

You are trying to pass only headers, and other data is also required. I got Examples from the documentation start like this:

url = 'https://fleet-api.taxi.yandex.net/v1/parks/Orders/List '
Print (Requests.post (URL, Headers = Headers, Data = JSON.DUMPS (DATA)). Text)

But not enough permission from your API key to get the result:

{"message": "API KEY DOES NOT SUFFICIENT PERMISSIONS"}

Data example for request:

data = {
 "Limit": 100,
 "Query": {
  "PARK": {
   "CAR": {
    "ID": "5011ADE6BA054DFDB7143C8CC9460DBC"
   },
   "Driver_Profile": {
    "ID": "33DE650C6A1A40BFA78DD981817DA866"
   },
   "ID": "EE6F33C4562B4E1F8646D157BD70B2C4",
   "Order": {
    "Booked_at": {
     "From": "2019-08-08T11: 58: 01 + 03: 00",
     "To": "2019-08-08T11: 58: 01 + 03: 00"
    },
    "Categories": "ECONOM",
    "Ended_at": {
     "From": "2019-08-08T11: 58: 01 + 03: 00",
     "To": "2019-08-08T11: 58: 01 + 03: 00"
    },
    IDS: "C8D40AcF182B4B32AF72F6AD2029031B",
    "payment_methods": "Card",
    "Price": {
     "FROM": "12345.1434",
     "To": "12345.1434"
    },
    "Providers": "Platform",
    "Short_ids": 248,
    "Statuses": "Complete"
   }
  }
 }
}

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions