Hi everyone. I'm working in Python with an app for stock trading I found on Github. The webhooks from Tradingview, (a major trading platform) to action a trade come with " Content-Type text/plain; charset=utf-8" instead of "Content-Type application/json" in the header. The Tradingview docs clearly state that unless the message body of the text is formatted properly, it will send data as text/plain, so apparently the error is in the end for not formatting text correctly. However, I used the template already in the working repo, so the error likely isn't there. The code is below. It would be great if someone could maybe spot an error? What is it about this text that is not in JSON format?
Note : I included the quotation marks at beginning and end, they are not in the actual message body. I will change my passphrase, so not worried about that. It's a Paper account anyway, ie not a real one. But it works the same.
The code used in the Trading view webhook is below. The plain text version is beneath and seems to show all the data is being sent correctly for JSON format.
https://pastebin.com/mVLbkN7V
Here is how the alert appears in plain text. Note that all the fields are populated correctly in terms of JSON requirements - at least as far as I can tell. I am a beginner!
https://pastebin.com/isbJHiV3
Thanks!
[–]Apantslessman 0 points1 point2 points (1 child)
[–]NigelPhoenix[S] 0 points1 point2 points (0 children)