.createCustomResponse(responseBody, c.getContentType(), responseCode, responseHeaders, responseClass);
public <T extends OAuthClientResponse> T execute(OAuthClientRequest request, Map<String, String> headers, String requestMethod, Class<T> responseClass) throws OAuthSystemException, OAuthProblemException { MediaType mediaType = MediaType.parse("application/json"); Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); if(headers != null) { for (Entry<String, String> entry : headers.entrySet()) { if (entry.getKey().equalsIgnoreCase("Content-Type")) { mediaType = MediaType.parse(entry.getValue()); } else { requestBuilder.addHeader(entry.getKey(), entry.getValue()); } } } RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; requestBuilder.method(requestMethod, body); try { Response response = client.newCall(requestBuilder.build()).execute(); return OAuthClientResponseFactory.createCustomResponse( response.body().string(), response.body().contentType().toString(), response.code(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); } }
public <T extends OAuthClientResponse> T execute(OAuthClientRequest request, Map<String, String> headers, String requestMethod, Class<T> responseClass) throws OAuthSystemException, OAuthProblemException { MediaType mediaType = MediaType.parse("application/json"); Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); if(headers != null) { for (Entry<String, String> entry : headers.entrySet()) { if (entry.getKey().equalsIgnoreCase("Content-Type")) { mediaType = MediaType.parse(entry.getValue()); } else { requestBuilder.addHeader(entry.getKey(), entry.getValue()); } } } RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; requestBuilder.method(requestMethod, body); try { Response response = client.newCall(requestBuilder.build()).execute(); return OAuthClientResponseFactory.createCustomResponse( response.body().string(), response.body().contentType().toString(), response.code(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); } }
public <T extends OAuthClientResponse> T execute(OAuthClientRequest request, Map<String, String> headers, String requestMethod, Class<T> responseClass) throws OAuthSystemException, OAuthProblemException { MediaType mediaType = MediaType.parse("application/json"); Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); if(headers != null) { for (Entry<String, String> entry : headers.entrySet()) { if (entry.getKey().equalsIgnoreCase("Content-Type")) { mediaType = MediaType.parse(entry.getValue()); } else { requestBuilder.addHeader(entry.getKey(), entry.getValue()); } } } RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; requestBuilder.method(requestMethod, body); try { Response response = client.newCall(requestBuilder.build()).execute(); return OAuthClientResponseFactory.createCustomResponse( response.body().string(), response.body().contentType().toString(), response.code(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); } }
public <T extends OAuthClientResponse> T execute(OAuthClientRequest request, Map<String, String> headers, String requestMethod, Class<T> responseClass) throws OAuthSystemException, OAuthProblemException { MediaType mediaType = MediaType.parse("application/json"); Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); if(headers != null) { for (Entry<String, String> entry : headers.entrySet()) { if (entry.getKey().equalsIgnoreCase("Content-Type")) { mediaType = MediaType.parse(entry.getValue()); } else { requestBuilder.addHeader(entry.getKey(), entry.getValue()); } } } RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; requestBuilder.method(requestMethod, body); try { Response response = client.newCall(requestBuilder.build()).execute(); return OAuthClientResponseFactory.createCustomResponse( response.body().string(), response.body().contentType().toString(), response.code(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); } }
public <T extends OAuthClientResponse> T execute(OAuthClientRequest request, Map<String, String> headers, String requestMethod, Class<T> responseClass) throws OAuthSystemException, OAuthProblemException { MediaType mediaType = MediaType.parse("application/json"); Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); if(headers != null) { for (Entry<String, String> entry : headers.entrySet()) { if (entry.getKey().equalsIgnoreCase("Content-Type")) { mediaType = MediaType.parse(entry.getValue()); } else { requestBuilder.addHeader(entry.getKey(), entry.getValue()); } } } RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; requestBuilder.method(requestMethod, body); try { Response response = client.newCall(requestBuilder.build()).execute(); return OAuthClientResponseFactory.createCustomResponse( response.body().string(), response.body().contentType().toString(), response.code(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); } }
public <T extends OAuthClientResponse> T execute(OAuthClientRequest request, Map<String, String> headers, String requestMethod, Class<T> responseClass) throws OAuthSystemException, OAuthProblemException { MediaType mediaType = MediaType.parse("application/json"); Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); if(headers != null) { for (Entry<String, String> entry : headers.entrySet()) { if (entry.getKey().equalsIgnoreCase("Content-Type")) { mediaType = MediaType.parse(entry.getValue()); } else { requestBuilder.addHeader(entry.getKey(), entry.getValue()); } } } RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; requestBuilder.method(requestMethod, body); try { Response response = client.newCall(requestBuilder.build()).execute(); return OAuthClientResponseFactory.createCustomResponse( response.body().string(), response.body().contentType().toString(), response.code(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); } }
public <T extends OAuthClientResponse> T execute(OAuthClientRequest request, Map<String, String> headers, String requestMethod, Class<T> responseClass) throws OAuthSystemException, OAuthProblemException { MediaType mediaType = MediaType.parse("application/json"); Request.Builder requestBuilder = new Request.Builder().url(request.getLocationUri()); if(headers != null) { for (Entry<String, String> entry : headers.entrySet()) { if (entry.getKey().equalsIgnoreCase("Content-Type")) { mediaType = MediaType.parse(entry.getValue()); } else { requestBuilder.addHeader(entry.getKey(), entry.getValue()); } } } RequestBody body = request.getBody() != null ? RequestBody.create(mediaType, request.getBody()) : null; requestBuilder.method(requestMethod, body); try { Response response = client.newCall(requestBuilder.build()).execute(); return OAuthClientResponseFactory.createCustomResponse( response.body().string(), response.body().contentType().toString(), response.code(), response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); } }
.createCustomResponse(responseBody, c.getContentType(), responseCode, responseHeaders, responseClass);
.createCustomResponse(responseBody, c.getContentType(), responseCode, responseHeaders, responseClass);
.createCustomResponse(responseBody, c.getContentType(), responseCode, responseHeaders, responseClass);
.createCustomResponse(responseBody, contentType, response.getStatusLine().getStatusCode(), getHeaders(response.getAllHeaders()), responseClass); } catch (Exception e) {
.createCustomResponse(responseBody, contentType, response.getStatusLine().getStatusCode(), getHeaders(response.getAllHeaders()), responseClass); } catch (Exception e) {
else { String respBody = response.getEntity(String.class); return OAuthClientResponseFactory.createCustomResponse( respBody, contentType,