Hi there,
Hoping someone can help with a really dumb question concerning API call.
I want to create a batch request for a Fetch XML query. After a day's effort I managed to get it working on Postman OK. But I cannot get it to work properly in Python because I cannot properly prepare the body of the API request.
Here is how the body looks in Postman:
But because it doesn't appear to be in the form of a dictionary, I am scratching my head how to prepare it in my Python script.
Worth mentioning when I save a copy of the body as a text file and use that as the source of the body for the API call in Python it works fine. But surely there is a way to prepare the request body without saving as a text file?
I sorted it. Being multipart, I can read the body as a string, though I needed to point the request at the first character, i.e request.post(url=requesturl,data=JSONString[0:])
, to avoid ".JSONDecodeError: Expecting value: line 1 column 1 (char 0)"
mmbr1606
22
Super User 2025 Season 1
stampcoin
17
ankit_singhal
11
Super User 2025 Season 1