private void setBody(ClientRequest request, MockHttpRequest mockHttpRequest) throws IOException { if (request.getBody() == null) return; }
private void outputBody(final ClientRequest request, final HttpURLConnection connection) if (request.getBody() != null)
private void setBody(ClientRequest request, MockHttpRequest mockHttpRequest) throws IOException { if (request.getBody() == null) return; }
private void outputBody(final ClientRequest request, final HttpURLConnection connection) if (request.getBody() != null)
private byte[] writeRequestEntity(ClientRequest clientRequest) { if (clientRequest.getBody() != null && !clientRequest.getFormParameters().isEmpty()) throw new RuntimeException("You cannot send both form parameters and an entity body"); if (!clientRequest.getFormParameters().isEmpty()) { throw new UnsupportedOperationException("InProcessClientExecutpr doesn't support form parameters yet"); } final ByteArrayOutputStream baos = new ByteArrayOutputStream(); if (clientRequest.getBody() != null) { if ("GET".equals(clientRequest.getHttpMethod())) throw new RuntimeException("A GET request cannot have a body."); try { clientRequest.writeRequestBody(clientRequest.getHeadersAsObjects(), baos); } catch (IOException e) { throw new RuntimeException(e); } } return baos.toByteArray(); }
private byte[] writeRequestEntity(ClientRequest clientRequest) { if (clientRequest.getBody() != null && !clientRequest.getFormParameters().isEmpty()) throw new RuntimeException("You cannot send both form parameters and an entity body"); if (!clientRequest.getFormParameters().isEmpty()) { throw new UnsupportedOperationException("InProcessClientExecutpr doesn't support form parameters yet"); } final ByteArrayOutputStream baos = new ByteArrayOutputStream(); if (clientRequest.getBody() != null) { if ("GET".equals(clientRequest.getHttpMethod())) throw new RuntimeException("A GET request cannot have a body."); try { clientRequest.writeRequestBody(clientRequest.getHeadersAsObjects(), baos); } catch (IOException e) { throw new RuntimeException(e); } } return baos.toByteArray(); }