amphp / http-client

An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.
https://amphp.org/http-client
MIT License
704 stars 66 forks source link

Add JsonContent #355

Closed trowski closed 11 months ago

trowski commented 11 months ago

Adds a simple JsonContent request body implementation, as sending a JSON body is very common.

trowski commented 11 months ago

@kelunik I made it a static method on BufferedContent. Does this seem appropriate or do you think it should be a regular function? If so, do you have a name suggestion? I was thinking createJsonContent.