code: public void convertToPost() {
          this.method = "POST";
  
          //add parameters, if available 
          StringBuilder bodyBuilder = new StringBuilder();
          boolean first = true;
  
          for (Parameter param : parameters) {
  
              if (!first) {
                  bodyBuilder.append("&");
              }
  
              bodyBuilder.append(param.getName());
              bodyBuilder.append("=");
              bodyBuilder.append(param.getValue());
  
              first = false;
          }
          this.body = bodyBuilder.toString();
          this.parameters = new ArrayList<>();
          this.sortedParams = null;
      }
docs: Converts a GET request to a POST request: changes request method and
  moves any URL parameters to the HTTP message body.