Creating a RESTFul API with Python and Flask [2 of 4] - POST Requests

preview_player
Показать описание
In this video, we will cover how to create POST requests using Python and Flask.

Рекомендации по теме
Комментарии
Автор

[SOLVED]
For those getting the error
language = {'name' : request.json['name']}
TypeError: 'NoneType' object is not subscriptable

in the postman menu, next to the radio buttons for raw and binary there will be a drop down menu like thing. Choose json there.
HTH

aneeshjoshi
Автор

Thank you a million times. Every time when am in problem i search for your video and you have helped so much.

avisekssarma
Автор

This tutorial is really good!
Thanks for uploading them

mo
Автор

With the most recent Flask (0.12) you need to get the POST'd data like that:

PavelZagalsky
Автор

thank you sir ur video helped me a lot : )

huseyinhealthh
Автор

hey. i followed after your instructions but i have a problem. and i dont understand why?
@app.route('/lang', methods=['POST'])
def addOne():
language = {'name' : request.json['name']} # have a problem 'NoneType' object is not subscriptable
languages.append(language)
return jsonify({'languages' : languages})
you have a solution?

inyoung
Автор

This is great tutorial however I want to know why would you use a non unique key (name) to your dictionary? It's a little confusing.

dhmketu
Автор

Is it possible to take input from the webpage, process it in the python code and generate output and display it back on the webpage using flask?

xyzabc
Автор

Now it's: language = request.get_json('name')

theleeclan
Автор

Hi,
i want get the data from database and send the data in excel file in flask rest Api so, how i can do ?
please help...

rahulsingh
Автор

Help: need to write the JSON output into csv file.

haanda
Автор

Anthony, good video. I'd like to see a video that illustrates an api endpoint that actually receives a file from the client. The client will post a form with a file and this api endpoint will take it and save it to the server for example. Can you show that? Thanks.

nokyere
Автор

request.json not working. The code isn't working for request.get_json either. Does the code require revision?

Cagebreaker