Skip to content

Setting empty str as data does not set text/plain header #5392

Closed
@spacemanspiff2007

Description

Setting empty str as data does not set text/plain header

await session.post(url, data='')

will set

'Content-Type': 'application/octet-stream'

in the header.

Expected would be

'Content-Type': 'text/plain'

This is also described in the docs.
It shows data as a shortcut for text/plain.

📋 Versions

Python/3.8
aiohttp/3.7.3

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions