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
701 stars 67 forks source link

Add JsonContent #355

Closed trowski closed 10 months ago

trowski commented 10 months ago

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

trowski commented 10 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.