收藏
回答

JSAPI下单 400 Bad Request

<html>

<head><title>400 Bad Request</title></head>

<body bgcolor="white">

<center><h1>400 Bad Request</h1></center>

<hr><center>nginx</center>

</body>

</html>

请求参数:

{"appid" : "wxad494b4cfb695596","mchid" : "1679325002","description" : "金石电子物联网流量服务购买","out_trade_no" : "171859079873000010","notify_url" : " https://fujsdz.com/wxGate", "amount" : {"total" : 1000,"currency" : "CNY"},"payer" : {"openid" : "ouHCx0r1hUL8vzmH6ER_kOc1gPi8"}}


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

1 个回答

  • Memory (私信不回复)
    Memory (私信不回复)
    06-17

    打印返回的body内容,有具体错误信息

    06-17
    有用
    回复 7
    • 刘俊林
      刘俊林
      06-17
      resp code = 400,return body = <html>
      <head><title>400 Bad Request</title></head>
      <body bgcolor="white">
      <center><h1>400 Bad Request</h1></center>
      <hr><center>nginx</center>
      </body>
      </html>
      06-17
      回复
    • Memory (私信不回复)
      Memory (私信不回复)
      06-17回复刘俊林
      看Responsebody信息,你这都没有打印出来
      06-17
      回复
    • 刘俊林
      刘俊林
      06-17回复Memory (私信不回复)
      CloseableHttpResponse response = httpClient.execute(httpPost);
         String bodyAsString = EntityUtils.toString(response.getEntity());
         System.out.println(bodyAsString);
      06-17
      回复
    • 刘俊林
      刘俊林
      06-17回复Memory (私信不回复)
      java如何打印返回的body内容
      06-17
      回复
    • 刘俊林
      刘俊林
      06-17回复Memory (私信不回复)
      打印返回的body内容
      06-17
      回复
    查看更多(2)
登录 后发表内容