I'm sure this is really banal and stupid but I cannot figure it out for the life of me.
I'm working with the Alchemy API, where the POST request using Requests looks like
r = requests.post(url, payload, headers=headers)
where payload is a dict with a field for url-encoded text like text=this%20is%text
The stupid problem I'm having is that if I use urllib for the encoding like myText = urlencode({'text': textToEncode})
I can't then insert it into the payload where payload={'text': myText}
because then I get something probably like text=text=this%20is%text
This would be so much simpler if I could just encode the string itself. The encoding function adds this stuff I can't turn around an insert into the dict because the whole dict gets encoded.
Am I missing something incredibly simple and dumb?