收藏
回答

对接微信商家券接口时候http状态返回415问题

HttpPost httpPost = new HttpPost("https://api.mch.weixin.qq.com/v3/marketing/busifavor/stocks/98065001/couponcodes");
    UploadCodeDto uploadCodeDto = new UploadCodeDto();
    List<String> list = new ArrayList();
    list.add("ABC9588200");
    list.add("ABC9588201");
    uploadCodeDto.setCoupon_code_list(list);
    uploadCodeDto.setUpload_request_no("100002322019090134234sfdf");
    String json = JSONObject.toJSONString(uploadCodeDto);
    System.err.println(json);
    StringEntity reqEntity = new StringEntity(//application/json
            json);
    httpPost.setEntity(reqEntity);
//    httpPost.addHeader("Accept", "application/json;charset=utf-8");
    httpPost.setHeader("Accept", "application/json;charset=utf-8");
    CloseableHttpResponse response = httpClient.execute(httpPost);
    System.err.println("response.getStatusLine().getStatusCode()=="+response.getStatusLine().getStatusCode());//415


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

1 个回答

  • 微信支付技术社区运营-Tasting
    微信支付技术社区运营-Tasting
    01-12

    您好,具体是商家券哪个接口的问题?请发下对应的开发文档,还有对应返回的Request-ID

    01-12
    有用
    回复
登录 后发表内容
问题标签