Skip to Content
Modern Python Standard Library Cookbook
book

Modern Python Standard Library Cookbook

by Alessandro Molina
August 2018
Intermediate to advanced
366 pages
10h 14m
English
Packt Publishing
Content preview from Modern Python Standard Library Cookbook

How it works...

multipart is practically based on encoding multiple requests within a single body. Each part is separated by a boundary and within the boundary lies the data of that part.

Each part can provide both data and metadata, such as the content type of the provided data.

This way the receiver can know whether the contained data is binary, text, or whatever. For example, the part specifying the value for the surname field of a form would look like this:

Content-Disposition: form-data; name="surname"

MySurname

And the part providing data for an uploaded file would look like this:

Content-Disposition: file; name="file1"; filename="somefile.txt"
Content-Type: text/plain

Some Content

Our MultiPartForm allows us to store aside both plain ...

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

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Advanced Python Development: Using Powerful Language Features in Real-World Applications

Matthew Wilkes

Publisher Resources

ISBN: 9781788830829Supplemental Content