Code example for Pair

0
        throws UnsupportedCharsetException { 
      if (postData != null) {
        String charset = getCharSetEncoding(contentType);
        try { 
          this.postData = new StringEntity(postData, charset);
          if (contentType != null) {
            this.postData.setContentType(new BasicHeader(CONTENT_TYPE_HEADER, contentType));
          } 
        } catch (UnsupportedEncodingException e) {
          UnsupportedCharsetException charsetException = new UnsupportedCharsetException(charset);
          charsetException.initCause(e);
          throw charsetException;
        } 
      } else { 
        this.postData = null;
      } 
      return this;
    } 
 
    @Override 
Experience pair programming with AI  Get Codota for Java