Forum Discussion
Issue with definition for Fabric event-stream API
- Anonymous1 year ago
Hi chetanhiwale
Thank you for reaching out microsoft fabric community forum.The issue looks like it’s coming from how the request is being sent. In your code, when you're calling the requests.post() method, you're passing the payload dictionary directly using data=payload. But the data parameter expects a JSON string, not a raw Python dictionary.
To fix this, try converting the payload to a JSON string before sending it. Just update this line:
data = payload
to:
data = json.dumps(payload)
That should resolve the “unexpected character” error ("d" is from the dict string). Also, make sure your base64-encoded definition is valid and the Eventstream/workspace IDs are correct.
If this solution helps, please consider giving us Kudos and accepting it as the solution so that it may assist other members in the community
Thank you.
I really don't know if this is the real error - but the word "definition" in the first line has a misspelling.
Else I would look for the error where it says "d" in the error message. It can uspbe a good hint, even though JSON parsing often just gives the first character from an arbitrary place during the parsing...
I hope you find the error - if it is not the misspelling in the beginning 😊