php post 提交需要中文不转码:json_encode($data, JSON_UNESCAPED_UNICODE) function curl_post($url, $data) { $data = json_encode($data, JSON_UNESCAPED_UNICODE); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json;charset=UTF-8;' ) ); $handles = curl_exec($ch); curl_close($ch); return json_decode($handles, true); }
标准交易组件获取商品列表为空https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/spu/get_spu_list.html 使用接口获取商品列表,返回为空,商店已有上架商品 https://api.weixin.qq.com/product/spu/get_list { "code": 200, "message": "success", - "data": { "errcode": 0, "spus": [ ], "total_num": 0 } }
2023-09-11php post 提交需要中文不转码:json_encode($data, JSON_UNESCAPED_UNICODE) function curl_post($url, $data) { $data = json_encode($data, JSON_UNESCAPED_UNICODE); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json;charset=UTF-8;' ) ); $handles = curl_exec($ch); curl_close($ch); return json_decode($handles, true); }
微信小商店交易组件搜索商品为什么搜索不到?$url = 'https://api.weixin.qq.com/product/spu/search?access_token='.$access_token; $params = [ 'source' => 1, 'page' => 1, 'page_size' => 10, 'keyword' => '方圆图', ]; appid:wx8c57701ead77cd40 文档链接:https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/spu/search_spu.html
2023-09-11