Changeset 9182 in josm for trunk/src/org/openstreetmap/josm/io/OsmApi.java
- Timestamp:
- 2015-12-27T22:01:58+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r9172 r9182 619 619 final HttpClient client = HttpClient.create(url, requestMethod).keepAlive(false); 620 620 if (fastFail) { 621 client.setConnectTimeout(1000); 621 622 client.setReadTimeout(1000); 623 } else { 624 // use default connect timeout from org.openstreetmap.josm.tools.HttpClient.connectTimeout 625 client.setReadTimeout(0); 622 626 } 623 627 if (doAuthenticate) { … … 626 630 627 631 if ("PUT".equals(requestMethod) || "POST".equals(requestMethod) || "DELETE".equals(requestMethod)) { 632 client.setHeader("Content-Type", "text/xml"); 628 633 // It seems that certain bits of the Ruby API are very unhappy upon 629 634 // receipt of a PUT/POST message without a Content-length header, … … 632 637 // we use the output stream, we create an output stream for PUT/POST 633 638 // even if there is no payload. 634 client.setRequestBody( requestBody.getBytes(StandardCharsets.UTF_8));639 client.setRequestBody((requestBody != null ? requestBody : "").getBytes(StandardCharsets.UTF_8)); 635 640 } 636 641
Note:
See TracChangeset
for help on using the changeset viewer.