1/5/2023 0 Comments Post flask python con json![]() ![]() If the issue still persists after making the above change to the processing function, post how you're making the json request elsewhere and I can take a look. not using the python requests library), another issue is that you may not be defining the json request properly for Flask to later interpret. If you're calling your function to process the stripe payment from somewhere else (i.e. To properly jsonify the data to return, we put the data into a python dictionary rather than into a string. The next issue was how you returned the data. Note from above that we needed to change how we actually made the request for it to parse the data properly. First, we read in the data by calling request.get_json(), which properly parses the incoming json data. I am using Flask: `įrom flask import Flask, request, run_post():ĭata = Ī couple of things are changed. ![]() I cannot get it to work and any help would be greatly appreciated as I've been stuck on this for a while. I have a python script that attempts to post a json object with four value pairs to another function that should extract the values, create a new json object and return that object. You may also want to check out all available functions/classes of the module flask.request, or try the search function. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. I have taken a step back to simplify the problem. The following are 30 code examples of (). The problem I have is I cannot figure out how to get Python to recognise the incoming json object to extract data from it and pass onto Stripe. The task I am trying to complete is to send a json object from an iPhone app to a python script that will process a stripe payment. ![]() Apologies if this seems rudimental as I am new to Python. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |