We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#public String post(HttpPost request, String postData) throws PostageAppException { request.addHeader(new BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json")); request.addHeader(HttpHeaders.USER_AGENT, this.getUserAgent());
HttpResponse postResponse; try { request.setEntity(new StringEntity(postData)); postResponse = this.httpClient.execute(request); if (postResponse.getStatusLine().getStatusCode() / 100 != 2) { throw new PostageAppException("Unable to connect to PostageApp servers for API endpoint " + request.getURI().toString()); } try { return IOUtils.toString(postResponse.getEntity().getContent()); } catch (Exception e) { throw new PostageAppException(e.getMessage()); } } catch (Exception e) { throw new PostageAppException(e.getMessage()); } finally { if (httpClient != null) { request.releaseConnection(); httpClient.getConnectionManager().closeExpiredConnections(); } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
#public String post(HttpPost request, String postData) throws PostageAppException {
request.addHeader(new BasicHeader(HttpHeaders.CONTENT_TYPE, "application/json"));
request.addHeader(HttpHeaders.USER_AGENT, this.getUserAgent());
The text was updated successfully, but these errors were encountered: