Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 832a36b

Browse files
committed
fixed rest post bug
1 parent 435a986 commit 832a36b

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

aliyun-java-sdk-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<groupId>com.aliyun</groupId>
44
<artifactId>aliyun-java-sdk-core</artifactId>
55
<packaging>jar</packaging>
6-
<version>2.3.6</version>
6+
<version>2.3.7</version>
77
<name>aliyun-java-sdk-core</name>
88
<url>http://www.aliyun.com</url>
99
<description>Aliyun Open API SDK for Java

aliyun-java-sdk-core/src/main/java/com/aliyuncs/http/HttpRequest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public void setContent(byte[] content, String encoding, FormatType format) {
129129

130130
if (null == content) {
131131
this.headers.remove(CONTENT_MD5);
132-
this.headers.remove(CONTENT_LENGTH);
132+
this.headers.put(CONTENT_LENGTH, "0");
133133
this.headers.remove(CONTENT_TYPE);
134134
this.contentType = null;
135135
this.content = null;
@@ -170,6 +170,7 @@ public HttpURLConnection getHttpConnection() throws IOException {
170170
else {
171171
url = new URL(strUrl);
172172
}
173+
System.setProperty("sun.net.http.allowRestrictedHeaders", "true");
173174
HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
174175
httpConn.setRequestMethod(this.method.toString());
175176
httpConn.setDoOutput(true);

aliyun-java-sdk-core/src/main/resources/com/aliyuncs/endpoints/endpoints.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<RegionId>cn-qingdao-cm9</RegionId>
1919
</RegionIds>
2020
<Products>
21+
<Product>
22+
<ProductName>AMS</ProductName>
23+
<DomainName>ams.aliyuncs.com</DomainName>
24+
</Product>
2125
<Product>
2226
<ProductName>Httpdns</ProductName>
2327
<DomainName>httpdns-api.aliyuncs.com</DomainName>
@@ -425,6 +429,14 @@
425429
</RegionIds>
426430
<Products>
427431
<Product>
432+
<ProductName>Ubsms</ProductName>
433+
<DomainName>ubsms.cn-qingdao.aliyuncs.com</DomainName>
434+
</Product>
435+
<Product>
436+
<ProductName>Ubsms-inner</ProductName>
437+
<DomainName>ubsms-inner.cn-qingdao.aliyuncs.com</DomainName>
438+
</Product>
439+
<Product>
428440
<ProductName>CmsSiteMonitor</ProductName>
429441
<DomainName>sitemonitor.aliyuncs.com</DomainName>
430442
</Product>

0 commit comments

Comments
 (0)