Changeset 13099 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2017-11-08T22:48:01+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #15531 - trace request body for HTTP POST, PUT and DELETE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/HttpClient.java

    r12921 r13099  
    1414import java.net.HttpURLConnection;
    1515import java.net.URL;
     16import java.nio.charset.StandardCharsets;
    1617import java.util.Collections;
    1718import java.util.List;
     
    114115        if ("PUT".equals(requestMethod) || "POST".equals(requestMethod) || "DELETE".equals(requestMethod)) {
    115116            Logging.info("{0} {1} ({2}) ...", requestMethod, url, Utils.getSizeString(requestBody.length, Locale.getDefault()));
     117            if (Logging.isTraceEnabled() && requestBody.length > 0) {
     118                Logging.trace("BODY: {0}", new String(requestBody, StandardCharsets.UTF_8));
     119            }
    116120            connection.setFixedLengthStreamingMode(requestBody.length);
    117121            connection.setDoOutput(true);
Note: See TracChangeset for help on using the changeset viewer.