private <T extends GMResponseBase> T _POST(URL url, GMRequestBase request, Class<T> responseType)
      throws GongmingConnectionException {

    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);

    RestTemplate restTemplate = new RestTemplate();
    ResponseEntity<T> responseEntity;
    T response;

    try {
      HttpEntity<String> entity = new HttpEntity<>(request.toQuery(url.getPath(), merchantSecret), headers);
      responseEntity = restTemplate.postForEntity(url.toString(), entity, responseType);
      response = responseEntity.getBody();
    } catch (HttpStatusCodeException e) {
      // This exception has status code, e.g. 404 Not Found
      throw new GongmingConnectionException(e.getStatusCode(), e);
    } catch (InvalidKeyException e) {
      throw new GongmingConnectionException("商户密钥不合法", e);
    }
    return response;
  }