Skip to Content
Learn Python by Building Data Science Applications
book

Learn Python by Building Data Science Applications

by Philipp Kats, David Katz
August 2019
Beginner
482 pages
12h 56m
English
Packt Publishing
Content preview from Learn Python by Building Data Science Applications

Sending data in with POST requests

All of this time, we used the @app.get method, which represents the expected HTTP GET request. As its name implies, this command is supposed to retrieve information and therefore is designed to store small snippets of data in itself. This data could be passed as resource—part of the URL, like complaint_type in the preceding exampleor appended as a parameter, like hour in our first example.

However, there are cases when you need to pass a significant data structure as part of your request. For that, there is another command: POST. You see, every request, technically, has three means of passing information:

  • URL, which can contain resources and parameters
  • BODY, which can store arbitrary data
  • HEADERS, a small ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python for Data Science

Python for Data Science

Yuli Vasiliev
Introduction to Machine Learning with Python

Introduction to Machine Learning with Python

Andreas C. Müller, Sarah Guido

Publisher Resources

ISBN: 9781789535365Supplemental Content