-1
private HttpPost getRequest() {
    HttpPost httpRequest = null;

    postParameter();

    String queryString = "";
    Set<Entry<String, String>> getPairs = this.parameterMap.entrySet();
    for (Entry<String, String> entry : getPairs) {
        try {
            queryString += URLEncoder.encode(entry.getKey(), this.CHARSET) + "=" + URLEncoder.encode(entry.getValue(), this.CHARSET) + "&";
        } catch (UnsupportedEncodingException e) {
        }
    }
    if (!queryString.isEmpty()) {
        queryString = "?" + queryString;
    }

    httpRequest = new HttpPost("http://mydomainname.com/java_test.php");
    String user_password = username+":"+password;
    byte[] Author = Base64.getEncoder().encode(user_password.getBytes());
    String Authorization = null;
    try {
        Authorization = new String(Author, "UTF-8");
    } catch (UnsupportedEncodingException e1) {
    }
    String partnerID ="XXXXXX";     
    httpRequest.setHeader("Authorization",Authorization);
    httpRequest.setHeader("PartnerId",partnerID);       
    httpRequest.addHeader(HttpHeaders.CONTENT_TYPE,"application/json");
    httpRequest.addHeader(HttpHeaders.ACCEPT,"application/json");               
    List<BasicNameValuePair> nameValuePairs = new ArrayList<BasicNameValuePair>();
    Set<Entry<String, String>> postPairs = this.postParametersMap.entrySet();
    for(Entry<String, String> entry : postPairs) {
        BasicNameValuePair pair = new BasicNameValuePair(entry.getKey(),
                entry.getValue());
        nameValuePairs.add(pair);
    }

    UrlEncodedFormEntity parameters = null;
    try {
        parameters = new UrlEncodedFormEntity(nameValuePairs, this.CHARSET);
    } catch (UnsupportedEncodingException e) {
    }

    httpRequest.setEntity(parameters);
    return httpRequest;
}

HTTPS POST ERROR 500 ON ABOVE REQUEST, THIS IS A SIMPLE HTTP CLIENT WITH CUSTOM HEADER (Authorization, partnerid, type, accept) with the JSON array.

SAME CODE IS FUNCTIONAL ON OTHER HOST JAVA 7 BUT NOT RUNNING ON JAVA 11.

1 Answers1

1

Code 500 is a server-error.

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500

The HyperText Transfer Protocol (HTTP) 500 Internal Server Error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

No problems on java side.

Grim
  • 1,938
  • 10
  • 56
  • 123