收藏
回答

【物流助手】云函数https请求错误 empty post data?

  var res = await rp({
    uri: 'https://api.weixin.qq.com/cgi-bin/express/local/business/order/pre_add?access_token='+access_token.access_token,
    method:"POST",
    data:{
      "shopid":"xxxxxx",
      "shop_order_id":"11",
      "shop_no":"489256",
      "delivery_sign":"xxxxxxx",
      "delivery_id":"UU",
      "openid":"xxxxxxxxxxxxx",
      "sender":{
        "name":"X先生",
        "city":"清远市",
        "address":"美林广场",
        "address_detail":"广东省清远市清新区笔架路美林宏景城对面",
        "phone":"12345678901",
        "lng":113.021766,
        "lat":23.734339
  
      },
      "receiver":{
        "name":"陈先生",
        "city":"清远市",
        "address":"碧水华庭",
        "address_detail":"广东省清远市清新区玄真路50号之1",
        "phone":"12345678901",
        "lng":113.018685,
        "lat":23.744526
  
      },
      "cargo":{
        "goods_value":1,
        "goods_weight":2,
        "cargo_first_class":"美食夜宵",
        "cargo_second_class":"零食小吃"
  
      },
      "order_info":{
        "delivery_service_code":"",
        "order_type":0,
        "expected_delivery_time":0,
        "expected_finish_time":0,
        "expected_pick_time":0,
        "poi_seq":"",
        "note":"",
        "order_time":0,
        "is_insured":0,
        "declared_value":0.00,
        "tips":0,
        "is_direct_delivery":0,
        "cash_on_delivery":0.00,
        "cash_on_pickup":0.00,
        "rider_pick_method":1,
        "is_finish_code_needed":0,
        "is_pickup_code_needed":0
      },
      "sub_biz_id":"0",
      "shop":{
        "wxa_path":"pages/mine/xxxxxx",
        "img_url":"https://xxxx.png",
        "goods_name":"快餐1",
        "goods_count":1,
        "wxa_appid":""
  
      }


    },


    json: true,
    headers:{
      "Content-Type": "application/json"


    },
 });  

返回

  1. errcode44002
  2. errmsg"empty post data rid: 639d4560-4666229e-4f90d851"



回答关注问题邀请回答
收藏

1 个回答

  • Mr.Zhao
    Mr.Zhao
    2022-12-17

    data改成body: {}

    2022-12-17
    有用
    回复 1
    • 🐷仔
      🐷仔
      发表于移动端
      2022-12-17
      感谢
      2022-12-17
      回复
登录 后发表内容