woohoolabs / yang

The efficient and elegant, PSR-7 compliant JSON:API 1.1 client library for PHP
MIT License
168 stars 13 forks source link

create/update/delete requests #14

Closed agamaya-user closed 5 years ago

agamaya-user commented 5 years ago

Is it possible to use library to generate create/update/delete requests?

kocsismate commented 5 years ago

Absolutely!

Have a look at the concerning part of the read me: https://github.com/woohoolabs/yang#request-builder

You can either use the request builder to set the HTTP method to POST/PATCH/DELETE (with $requestBuilder::setMethod()) or you can do the same with a PSR-7 compliant request object like this: $request = $request->withMethod("POST").