hightman / httpclient

A parallel HTTP client written in pure PHP
MIT License
107 stars 22 forks source link

setJsonBody() multiple array issues #8

Closed gitaccxz closed 3 years ago

gitaccxz commented 3 years ago

Its PATCH request.

This is my json post data

{"user": {"profile_attributes": {"one_liner": "'.$title.'"}}}

i am trying like this but not working:

$request->setJsonBody(["user" => ["profile_attributes" => ["one_liner" => $title]]]);
hightman commented 3 years ago

see https://github.com/hightman/httpclient/blob/dcc4f476f7c20dd445df43a4f6988227a841a909/src/Request.php#L209

now only PUT and POST requests has body data.

在 2021年11月6日,23:21,gitaccxz @.***> 写道:

 This is my json post data

{"user": {"profile_attributes": {"one_liner": "'.$title.'"}}} i am trying like this but not working:

$request->setJsonBody(['user' => ['profile_attributes' => ['one_liner' => $title]]]); — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

gitaccxz commented 3 years ago

No PATCH request data. Plz add it

gitaccxz commented 3 years ago

i added it. Thanks