Skip to content

Commit 92e2a4a

Browse files
XueSiLfPlayer626
authored andcommitted
fix:修复部分接口未指定content-type的bug
1 parent bdbaacf commit 92e2a4a

File tree

26 files changed

+124
-0
lines changed

26 files changed

+124
-0
lines changed

src/MiniProgram/Broadcast/Client.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function create(array $goodsInfo)
3535

3636
$response = $this->getClient()
3737
->setMethod('POST')
38+
->setHeaders(['content-type' => 'application/json'])
3839
->setBody($this->jsonDataToStream($params))
3940
->send($this->buildUrl(
4041
'/wxaapi/broadcast/goods/add',
@@ -64,6 +65,7 @@ public function resetAudit(int $auditId, int $goodsId)
6465

6566
$response = $this->getClient()
6667
->setMethod('POST')
68+
->setHeaders(['content-type' => 'application/json'])
6769
->setBody($this->jsonDataToStream($params))
6870
->send($this->buildUrl(
6971
'/wxaapi/broadcast/goods/resetaudit',
@@ -89,6 +91,7 @@ public function resubmitAudit(int $goodsId)
8991

9092
$response = $this->getClient()
9193
->setMethod('POST')
94+
->setHeaders(['content-type' => 'application/json'])
9295
->setBody($this->jsonDataToStream($params))
9396
->send($this->buildUrl(
9497
'/wxaapi/broadcast/goods/audit',
@@ -117,6 +120,7 @@ public function delete(int $goodsId)
117120

118121
$response = $this->getClient()
119122
->setMethod('POST')
123+
->setHeaders(['content-type' => 'application/json'])
120124
->setBody($this->jsonDataToStream($params))
121125
->send($this->buildUrl(
122126
'/wxaapi/broadcast/goods/delete',
@@ -142,6 +146,7 @@ public function update(array $goodsInfo)
142146

143147
$response = $this->getClient()
144148
->setMethod('POST')
149+
->setHeaders(['content-type' => 'application/json'])
145150
->setBody($this->jsonDataToStream($params))
146151
->send($this->buildUrl(
147152
'/wxaapi/broadcast/goods/update',
@@ -167,6 +172,7 @@ public function getGoodsWarehouse(array $goodsIdArray)
167172

168173
$response = $this->getClient()
169174
->setMethod('POST')
175+
->setHeaders(['content-type' => 'application/json'])
170176
->setBody($this->jsonDataToStream($params))
171177
->send($this->buildUrl(
172178
'/wxa/business/getgoodswarehouse',
@@ -217,6 +223,7 @@ public function createLiveRoom(array $params)
217223
{
218224
$response = $this->getClient()
219225
->setMethod('POST')
226+
->setHeaders(['content-type' => 'application/json'])
220227
->setBody($this->jsonDataToStream($params))
221228
->send($this->buildUrl(
222229
'/wxaapi/broadcast/room/create',
@@ -246,6 +253,7 @@ public function getRooms(int $start = 0, int $limit = 10)
246253

247254
$response = $this->getClient()
248255
->setMethod('POST')
256+
->setHeaders(['content-type' => 'application/json'])
249257
->setBody($this->jsonDataToStream($params))
250258
->send($this->buildUrl(
251259
'/wxa/business/getliveinfo',
@@ -278,6 +286,7 @@ public function getPlaybacks(int $roomId, int $start = 0, int $limit = 10)
278286

279287
$response = $this->getClient()
280288
->setMethod('POST')
289+
->setHeaders(['content-type' => 'application/json'])
281290
->setBody($this->jsonDataToStream($params))
282291
->send($this->buildUrl(
283292
'/wxa/business/getliveinfo',
@@ -301,6 +310,7 @@ public function addGoods(array $params)
301310
{
302311
$response = $this->getClient()
303312
->setMethod('POST')
313+
->setHeaders(['content-type' => 'application/json'])
304314
->setBody($this->jsonDataToStream($params))
305315
->send($this->buildUrl(
306316
'/wxaapi/broadcast/room/addgoods',
@@ -322,6 +332,7 @@ public function deleteLiveRoom(array $params)
322332
{
323333
$response = $this->getClient()
324334
->setMethod('POST')
335+
->setHeaders(['content-type' => 'application/json'])
325336
->setBody($this->jsonDataToStream($params))
326337
->send($this->buildUrl(
327338
'/wxaapi/broadcast/room/deleteroom',
@@ -343,6 +354,7 @@ public function updateLiveRoom(array $params)
343354
{
344355
$response = $this->getClient()
345356
->setMethod('POST')
357+
->setHeaders(['content-type' => 'application/json'])
346358
->setBody($this->jsonDataToStream($params))
347359
->send($this->buildUrl(
348360
'/wxaapi/broadcast/room/editroom',
@@ -412,6 +424,7 @@ public function addAssistant(array $params)
412424
{
413425
$response = $this->getClient()
414426
->setMethod('POST')
427+
->setHeaders(['content-type' => 'application/json'])
415428
->setBody($this->jsonDataToStream($params))
416429
->send($this->buildUrl(
417430
'/wxaapi/broadcast/room/addassistant',
@@ -433,6 +446,7 @@ public function updateAssistant(array $params)
433446
{
434447
$response = $this->getClient()
435448
->setMethod('POST')
449+
->setHeaders(['content-type' => 'application/json'])
436450
->setBody($this->jsonDataToStream($params))
437451
->send($this->buildUrl(
438452
'/wxaapi/broadcast/room/modifyassistant',
@@ -454,6 +468,7 @@ public function deleteAssistant(array $params)
454468
{
455469
$response = $this->getClient()
456470
->setMethod('POST')
471+
->setHeaders(['content-type' => 'application/json'])
457472
->setBody($this->jsonDataToStream($params))
458473
->send($this->buildUrl(
459474
'/wxaapi/broadcast/room/removeassistant',
@@ -498,6 +513,7 @@ public function addSubAnchor(array $params)
498513
{
499514
$response = $this->getClient()
500515
->setMethod('POST')
516+
->setHeaders(['content-type' => 'application/json'])
501517
->setBody($this->jsonDataToStream($params))
502518
->send($this->buildUrl(
503519
'/wxaapi/broadcast/room/addsubanchor',
@@ -519,6 +535,7 @@ public function updateSubAnchor(array $params)
519535
{
520536
$response = $this->getClient()
521537
->setMethod('POST')
538+
->setHeaders(['content-type' => 'application/json'])
522539
->setBody($this->jsonDataToStream($params))
523540
->send($this->buildUrl(
524541
'/wxaapi/broadcast/room/modifysubanchor',
@@ -540,6 +557,7 @@ public function deleteSubAnchor(array $params)
540557
{
541558
$response = $this->getClient()
542559
->setMethod('POST')
560+
->setHeaders(['content-type' => 'application/json'])
543561
->setBody($this->jsonDataToStream($params))
544562
->send($this->buildUrl(
545563
'/wxaapi/broadcast/room/deletesubanchor',
@@ -591,6 +609,7 @@ public function updateFeedPublic(array $params)
591609
{
592610
$response = $this->getClient()
593611
->setMethod('POST')
612+
->setHeaders(['content-type' => 'application/json'])
594613
->setBody($this->jsonDataToStream($params))
595614
->send($this->buildUrl(
596615
'/wxaapi/broadcast/room/updatefeedpublic',
@@ -612,6 +631,7 @@ public function updateReplay(array $params)
612631
{
613632
$response = $this->getClient()
614633
->setMethod('POST')
634+
->setHeaders(['content-type' => 'application/json'])
615635
->setBody($this->jsonDataToStream($params))
616636
->send($this->buildUrl(
617637
'/wxaapi/broadcast/room/updatereplay',
@@ -633,6 +653,7 @@ public function updateKf(array $params)
633653
{
634654
$response = $this->getClient()
635655
->setMethod('POST')
656+
->setHeaders(['content-type' => 'application/json'])
636657
->setBody($this->jsonDataToStream($params))
637658
->send($this->buildUrl(
638659
'/wxaapi/broadcast/room/updatekf',
@@ -654,6 +675,7 @@ public function updateComment(array $params)
654675
{
655676
$response = $this->getClient()
656677
->setMethod('POST')
678+
->setHeaders(['content-type' => 'application/json'])
657679
->setBody($this->jsonDataToStream($params))
658680
->send($this->buildUrl(
659681
'/wxaapi/broadcast/room/updatecomment',
@@ -675,6 +697,7 @@ public function updateGoodsInRoom(array $params)
675697
{
676698
$response = $this->getClient()
677699
->setMethod('POST')
700+
->setHeaders(['content-type' => 'application/json'])
678701
->setBody($this->jsonDataToStream($params))
679702
->send($this->buildUrl(
680703
'/wxaapi/broadcast/goods/onsale',
@@ -696,6 +719,7 @@ public function deleteGoodsInRoom(array $params)
696719
{
697720
$response = $this->getClient()
698721
->setMethod('POST')
722+
->setHeaders(['content-type' => 'application/json'])
699723
->setBody($this->jsonDataToStream($params))
700724
->send($this->buildUrl(
701725
'/wxaapi/broadcast/goods/deleteInRoom',
@@ -717,6 +741,7 @@ public function pushGoods(array $params)
717741
{
718742
$response = $this->getClient()
719743
->setMethod('POST')
744+
->setHeaders(['content-type' => 'application/json'])
720745
->setBody($this->jsonDataToStream($params))
721746
->send($this->buildUrl(
722747
'/wxaapi/broadcast/goods/push',
@@ -738,6 +763,7 @@ public function sortGoods(array $params)
738763
{
739764
$response = $this->getClient()
740765
->setMethod('POST')
766+
->setHeaders(['content-type' => 'application/json'])
741767
->setBody($this->jsonDataToStream($params))
742768
->send($this->buildUrl(
743769
'/wxaapi/broadcast/goods/sort',
@@ -759,6 +785,7 @@ public function downloadGoodsExplanationVideo(array $params)
759785
{
760786
$response = $this->getClient()
761787
->setMethod('POST')
788+
->setHeaders(['content-type' => 'application/json'])
762789
->setBody($this->jsonDataToStream($params))
763790
->send($this->buildUrl(
764791
'/wxaapi/broadcast/goods/getVideo',
@@ -783,6 +810,7 @@ public function addRole(array $params)
783810
{
784811
$response = $this->getClient()
785812
->setMethod('POST')
813+
->setHeaders(['content-type' => 'application/json'])
786814
->setBody($this->jsonDataToStream($params))
787815
->send($this->buildUrl(
788816
'/wxaapi/broadcast/role/addrole',
@@ -804,6 +832,7 @@ public function deleteRole(array $params)
804832
{
805833
$response = $this->getClient()
806834
->setMethod('POST')
835+
->setHeaders(['content-type' => 'application/json'])
807836
->setBody($this->jsonDataToStream($params))
808837
->send($this->buildUrl(
809838
'/wxaapi/broadcast/role/deleterole',
@@ -851,6 +880,7 @@ public function getFollowers(array $params)
851880
{
852881
$response = $this->getClient()
853882
->setMethod('POST')
883+
->setHeaders(['content-type' => 'application/json'])
854884
->setBody($this->jsonDataToStream($params))
855885
->send($this->buildUrl(
856886
'/wxa/business/get_wxa_followers',
@@ -874,6 +904,7 @@ public function pushMessage(array $params)
874904
{
875905
$response = $this->getClient()
876906
->setMethod('POST')
907+
->setHeaders(['content-type' => 'application/json'])
877908
->setBody($this->jsonDataToStream($params))
878909
->send($this->buildUrl(
879910
'/wxa/business/push_message',

src/OpenPlatform/Authorizer/OfficialAccount/Account/Client.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public function register(string $ticket, float $timeout = 10)
5959
$response = $this->getClient()
6060
->setTimeout($timeout)
6161
->setMethod("POST")
62+
->setHeaders(['content-type' => 'application/json'])
6263
->setBody($this->jsonDataToStream([
6364
'ticket' => $ticket,
6465
]))->send($this->buildUrl(

src/Work/Agent/Client.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function set(int $agentId, array $attributes)
4949
{
5050
$response = $this->getClient()
5151
->setMethod('POST')
52+
->setHeaders(['content-type' => 'application/json'])
5253
->setBody($this->jsonDataToStream([
5354
array_merge(['agentid' => $agentId], $attributes)
5455
]))

src/Work/Agent/WorkbenchClient.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function setWorkbenchTemplate(array $params)
2626
{
2727
$response = $this->getClient()
2828
->setMethod('POST')
29+
->setHeaders(['content-type' => 'application/json'])
2930
->setBody($this->jsonDataToStream($params))
3031
->send($this->buildUrl('/cgi-bin/agent/set_workbench_template',
3132
['access_token' => $this->app[ServiceProviders::AccessToken]->getToken()]
@@ -50,6 +51,7 @@ public function getWorkbenchTemplate(int $agentId)
5051

5152
$response = $this->getClient()
5253
->setMethod('POST')
54+
->setHeaders(['content-type' => 'application/json'])
5355
->setBody($this->jsonDataToStream($params))
5456
->send($this->buildUrl('/cgi-bin/agent/get_workbench_template',
5557
['access_token' => $this->app[ServiceProviders::AccessToken]->getToken()]
@@ -71,6 +73,7 @@ public function setWorkbenchData(array $params)
7173
{
7274
$response = $this->getClient()
7375
->setMethod('POST')
76+
->setHeaders(['content-type' => 'application/json'])
7477
->setBody($this->jsonDataToStream($params))
7578
->send($this->buildUrl('/cgi-bin/agent/set_workbench_data',
7679
['access_token' => $this->app[ServiceProviders::AccessToken]->getToken()]

src/Work/Calendar/Client.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function add(array $calendar)
2626
{
2727
$response = $this->getClient()
2828
->setMethod('POST')
29+
->setHeaders(['content-type' => 'application/json'])
2930
->setBody($this->jsonDataToStream(compact('calendar')))
3031
->send($this->buildUrl(
3132
'/cgi-bin/oa/calendar/add',
@@ -55,6 +56,7 @@ public function update(string $id, array $calendar)
5556

5657
$response = $this->getClient()
5758
->setMethod('POST')
59+
->setHeaders(['content-type' => 'application/json'])
5860
->setBody($this->jsonDataToStream(compact('calendar')))
5961
->send($this->buildUrl(
6062
'/cgi-bin/oa/calendar/update',
@@ -80,6 +82,7 @@ public function get($ids)
8082
{
8183
$response = $this->getClient()
8284
->setMethod('POST')
85+
->setHeaders(['content-type' => 'application/json'])
8386
->setBody($this->jsonDataToStream(['cal_id_list' => (array)$ids]))
8487
->send($this->buildUrl(
8588
'/cgi-bin/oa/calendar/get',
@@ -106,6 +109,7 @@ public function delete(string $id)
106109
{
107110
$response = $this->getClient()
108111
->setMethod('POST')
112+
->setHeaders(['content-type' => 'application/json'])
109113
->setBody($this->jsonDataToStream(['cal_id' => $id]))
110114
->send($this->buildUrl(
111115
'/cgi-bin/oa/calendar/del',

src/Work/Chat/Client.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function create(array $data)
5353
{
5454
$response = $this->getClient()
5555
->setMethod('POST')
56+
->setHeaders(['content-type' => 'application/json'])
5657
->setBody($this->jsonDataToStream($data))
5758
->send($this->buildUrl(
5859
'/cgi-bin/appchat/create',
@@ -79,6 +80,7 @@ public function update(string $chatId, array $data)
7980
{
8081
$response = $this->getClient()
8182
->setMethod('POST')
83+
->setHeaders(['content-type' => 'application/json'])
8284
->setBody($this->jsonDataToStream(array_merge(['chatid' => $chatId], $data)))
8385
->send($this->buildUrl(
8486
'/cgi-bin/appchat/update',
@@ -103,6 +105,7 @@ public function send(array $message)
103105
{
104106
$response = $this->getClient()
105107
->setMethod('POST')
108+
->setHeaders(['content-type' => 'application/json'])
106109
->setBody($this->jsonDataToStream($message))
107110
->send($this->buildUrl(
108111
'/cgi-bin/appchat/send',

src/Work/CorpGroup/Client.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function getAppShareInfo(int $agentId)
2929

3030
$response = $this->getClient()
3131
->setMethod('POST')
32+
->setHeaders(['content-type' => 'application/json'])
3233
->setBody($this->jsonDataToStream($params))
3334
->send($this->buildUrl(
3435
'/cgi-bin/corpgroup/corp/list_app_share_info',
@@ -60,6 +61,7 @@ public function getToken(string $corpId, int $agentId)
6061

6162
$response = $this->getClient()
6263
->setMethod('POST')
64+
->setHeaders(['content-type' => 'application/json'])
6365
->setBody($this->jsonDataToStream($params))
6466
->send($this->buildUrl(
6567
'/cgi-bin/corpgroup/corp/gettoken',
@@ -90,6 +92,7 @@ public function getMiniProgramTransferSession(string $userId, string $sessionKey
9092

9193
$response = $this->getClient()
9294
->setMethod('POST')
95+
->setHeaders(['content-type' => 'application/json'])
9396
->setBody($this->jsonDataToStream($params))
9497
->send($this->buildUrl(
9598
'/cgi-bin/miniprogram/transfer_session',

src/Work/Department/Client.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public function create(array $data)
2626
{
2727
$response = $this->getClient()
2828
->setMethod('POST')
29+
->setHeaders(['content-type' => 'application/json'])
2930
->setBody($this->jsonDataToStream($data))
3031
->send($this->buildUrl(
3132
'/cgi-bin/department/create',
@@ -52,6 +53,7 @@ public function update(int $id, array $data)
5253
{
5354
$response = $this->getClient()
5455
->setMethod('POST')
56+
->setHeaders(['content-type' => 'application/json'])
5557
->setBody($this->jsonDataToStream(array_merge(compact('id'), $data)))
5658
->send($this->buildUrl(
5759
'/cgi-bin/department/update',

0 commit comments

Comments
 (0)