Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【小程序】微信物流服务-消息组件:4.1、传运单接口 follow_waybill增加参数 delivery_id 运力id(运单号所属运… #3294

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ public class FollowWaybillRequest implements Serializable {
@SerializedName("receiver_phone")
private String receiverPhone;

/**
* 运力id(运单号所属运力公司id),该字段从 <a href='https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/express_open_msg.html#_4-4%E8%8E%B7%E5%8F%96%E8%BF%90%E5%8A%9Bid%E5%88%97%E8%A1%A8get-delivery-list'>get_delivery_list</a> 获取。
* <pre>
* 是否必填: 否
* 描述:该参数用于提高运单号识别的准确度;特别是对非主流快递公司,建议传入该参数,确保查询正确率。
* </pre>
*/
@SerializedName("delivery_id")
private String deliveryId;

/**
* 运单ID
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ public WxMpMaterialUploadResult execute(String uri, WxMpMaterial material, WxTyp
multipartEntityBuilder.addPart("description",
new StringBody(WxGsonBuilder.create().toJson(form), ContentType.create("text/plain", Consts.UTF_8)));
}

httpPost.setEntity(multipartEntityBuilder.build());
//手动设置的Content-Type请求头没有boundary,是一个非标准的文件上传请求头,虽然微信提供了对这类非标准请求的支持,但如果请求需要先经过我们的tomcat server,那么都会报错:the request was rejected because no multipart boundary was found
//不设置Content-Type请求头,httpclient将会自动设置,值为entity的getContentType方法返回值。MultipartEntityBuilder的getContentType方法将会返回boundary
//httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString());

try (CloseableHttpResponse response = requestHttp.getRequestHttpClient().execute(httpPost)) {
String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public WxMediaImgUploadResult execute(String uri, File data, WxType wxType) thro
.setMode(HttpMultipartMode.RFC6532)
.build();
httpPost.setEntity(entity);
httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString());

try (CloseableHttpResponse response = requestHttp.getRequestHttpClient().execute(httpPost)) {
String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public Boolean execute(String uri, File data, WxType wxType) throws WxErrorExcep
.setMode(HttpMultipartMode.RFC6532)
.build();
httpPost.setEntity(entity);
httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString());

try (CloseableHttpResponse response = requestHttp.getRequestHttpClient().execute(httpPost)) {
String responseContent = Utf8ResponseHandler.INSTANCE.handleResponse(response);
Expand Down