Skip to content Skip to sidebar Skip to footer

Sending Files Using Python 'aiohttp' Produce "there Was An Error Parsing The Body"

I am trying to make two services communicate. The first API is exposed to the user. The second is hidden and can process files. So the first can redirect requests. I want to make o

Solution 1:

From this answer:

If you are using one of multipart/* content types, you are actually required to specify the boundary parameter in the Content-Type header, otherwise the server (in the case of an HTTP request) will not be able to parse the payload.

You need to remove the explicit setting of the Content-Type header, the client aiohttp will add it implicitly for you, including the boundary parameter.

Post a Comment for "Sending Files Using Python 'aiohttp' Produce "there Was An Error Parsing The Body""