当前位置:网站首页>Leaky API interface practical development series (13): gooseneck cloud service php-api two-dimensional array parameter transfer solution
Leaky API interface practical development series (13): gooseneck cloud service php-api two-dimensional array parameter transfer solution
2022-06-25 23:29:00 【Missed engraving sometimes】
Using the gosling cloud service API Development process , When passing a two-dimensional array , Always prompt in the background The user id list must be an array. That is, the passed parameter must be an array .
Document request standard format
{
"access_token": "xxxxxxxx",
"user_id_list": [
"u_xxxx",
"u_xxxx",
"u_xxxx"
],
"page": 1,
"page_size": 3
}
among "user_id_list" It's a two-dimensional array .
PHP Reference page
require_once __DIR__ . '/libs/Client.php';
$client = new Client();
$url = "https://api.xiaoe-tech.com/xe.user.batch_by_user_id.get/1.0.0";
$method = "post";
// Gets individual user information ;
$page_size = $_GET['page_size'];
if ($page_size == "") {
$page_size = 10;
}
$user_id_list = ['u_62b29be26704d_0cjjzuCSNk', '"u_62b2c2c2a121f_uFYhvzwnUP'];
$params = ['user_id_list' => $user_id_list, 'page' => 1, 'page_size' => $page_size];
$result = $client->request($method, $url, $params);
die(json_encode($result));
Return content
{
"req_msg":"The user id list must be an array.",
"req_code":8
}
Error page
Mocha ITOM – Request log :
Solution
take
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
It is amended as follows
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postdata));
http_build_query() Is to convert an array to url question mark ? The following parameter string , And it will be done automatically urlencode Handle .

@lockdata.cn
边栏推荐
- Idea auto generator generates constructor get/set methods, etc
- How to add cartoon characters to the blog park?
- Leetcode(605)——种花问题
- Unity technical manual - life cycle rotation rotationoverlifetime- speed rotation rotationbyspeed- and external forces
- 论文笔记: 多标签学习 MSWL
- Live800在线客服系统:跨越时空做生意,从每次互动开始
- Es6-- set
- Unity technical manual - getKey and getaxis and getbutton
- Pycharm student's qualification expires, prompting no suitable licenses associated with account solution
- CTS RTS RX TX in serial port flow control UART (direct communication between serial port module and MCU)
猜你喜欢

Paper notes: multi tag learning MSWl
![[opencv450 samples] inpaint restores the selected region in the image using the region neighborhood](/img/36/8ad6034473382f66f315eb70440711.png)
[opencv450 samples] inpaint restores the selected region in the image using the region neighborhood

Unity的Ping类使用
![[modulebuilder] GP service realizes the intersection selection of two layers in SDE](/img/4a/899a3c2a0505d2ec2eaae97a3948c9.png)
[modulebuilder] GP service realizes the intersection selection of two layers in SDE

Fastjson反序列化随机性失败

一位博士在华为的22年

Meta universe standard forum established

UE4\UE5 蓝图节点Delay与Retriggerable Delay的使用与区别
[email protected]@COLLATION_ CONNECTION */"/>. SQL database import error: / *! 40101 SET @OLD_ COLLATION_ [email protected]@COLLATION_ CONNECTION */

RepOptimizer: 其实是RepVGG2
随机推荐
The Ping class of unity uses
ACM. HJ16 购物单 ●●
多台云服务器的 Kubernetes 集群搭建
Use and difference between ue4\ue5 blueprint node delay and retroggable delay
Huawei cloud SRE deterministic operation and maintenance special issue (the first issue)
做接口测试,这3种工具到底什么时候用?
As a programmer, how can we learn, grow and progress happily? (personal perception has nothing to do with technology)
【ModuleBuilder】GP服务实现SDE中两个图层相交选取
CDN加速是什么
C language (I)
Implementation of sequence table: static and dynamic
Actual combat: how to quickly change font color in typera (blog sharing - perfect) -2022.6.25 (solved)
CTS RTS RX TX in serial port flow control UART (direct communication between serial port module and MCU)
Several optimization scenarios using like fuzzy retrieval in SQL
Flex & Bison Start
How to use drawing comparison function in CAD
[opencv450 samples] read the image path list and maintain the proportional display
Leetcode(435)——无重叠区间
UE4_UE5結合offline voice recognition插件做語音識別功能
问题记录与思考