module documentation
Undocumented
Class |
|
:class:`MultiPartProducer` takes parameters for a HTTP request and produces bytes in multipart/form-data format defined in :rfc:`2388` and :rfc:`2046`. |
Constant | CRLF |
Undocumented |
Class | _ |
`_Header` This class is a tiny wrapper that produces request headers. We can't use standard python header class because it encodes unicode fields using =? bla bla ?= encoding, which is correct, but no one in HTTP world expects that, everyone wants utf-8 raw bytes. |
Class | _ |
`_LengthConsumer` is used to calculate the length of the multi-part request. The easiest way to do that is to consume all the fields, but instead writing them to the string just accumulate the request length. |
Function | _converted |
Undocumented |
Function | _enforce |
This function enforces the strings passed to be unicode, so we won't need to guess what's the encoding of the binary strings passed in. If someone needs to pass the binary string, use BytesIO and wrap it with `FileBodyProducer`. |
Function | _escape |
This function prevents header values from corrupting the request, a newline in the file name parameter makes form-data request unreadable for majority of parsers. |
Function | _sorted |
Sorts params so that strings are placed before files. |
This function enforces the strings passed to be unicode, so we won't need to guess what's the encoding of the binary strings passed in. If someone needs to pass the binary string, use BytesIO and wrap it with `FileBodyProducer`.
This function prevents header values from corrupting the request, a newline in the file name parameter makes form-data request unreadable for majority of parsers.