Method posts request payload

@param request
@param payload
@return
492863
protected HttpResponse sendPayload(HttpEntityEnclosingRequestBase request, byte[] payload) {
    HttpResponse response = null;
    try {
      log(request);
      HttpClient httpclient = new DefaultHttpClient();
      request.setEntity(new ByteArrayEntity(payload));
      response = httpclient.execute(request);
      log(response);
    } catch(IOException ioe) {
      throw new EFhirClientException("Error sending HTTP Post/Put Payload: "+ioe.getMessage(), ioe);
    }
    return response;
  }
953211
def send_request(payload)
      response = @http.post payload
      raise APIError, response unless response.is_a?(Net::HTTPSuccess)
      response
    end
971920
private void addPostParams(final Request request) {
        if (body != null) {
            request.addPostParam("Body", body);
        }

        if (attributes != null) {
            request.addPostParam("Attributes", attributes);
        }
    }
1372507
private void addPostParams(final Request request) {
        if (publicKey != null) {
            request.addPostParam("PublicKey", publicKey.toString());
        }

        if (friendlyName != null) {
            request.addPostParam("FriendlyName", friendlyName);
        }

        if (accountSid != null) {
            request.addPostParam("AccountSid", accountSid);
        }
    }
730681
private <T> PubsubFuture<T> post(final String operation, final String path, final Object payload,
                                   final ResponseReader<T> responseReader) {
    return request(operation, HttpMethod.POST, path, payload, responseReader);
  }
62243
private void parseRequest(HttpMethod httpMethod, HttpRequestBase request, JsonObject payload) throws MPException {
        this.method = httpMethod.toString();
        this.url = request.getURI().toString();
        if (payload != null) {
            this.payload = payload.toString();
        }
    }
117556
private void addPostParams(final Request request) {
        if (callbackMethod != null) {
            request.addPostParam("CallbackMethod", callbackMethod.toString());
        }

        if (callbackUrl != null) {
            request.addPostParam("CallbackUrl", callbackUrl.toString());
        }

        if (friendlyName != null) {
            request.addPostParam("FriendlyName", friendlyName);
        }
    }
328661
@Override
	public HttpRequest createPayloadSendRequest(PayloadData payload, HttpRequest.Listener<HttpRequest> listener) {
		if (payload == null) {
			throw new IllegalArgumentException("Payload is null");
		}

		HttpRequest request = createPayloadRequest(payload);
		request.addListener(listener);
		return request;
	}
658621
private void addPostParams(final Request request) {
        if (attributes != null) {
            request.addPostParam("Attributes", attributes);
        }

        if (dateCreated != null) {
            request.addPostParam("DateCreated", dateCreated.toString());
        }

        if (dateUpdated != null) {
            request.addPostParam("DateUpdated", dateUpdated.toString());
        }
    }
572942
def post(path, payload, additional_options = {})
      raise PayloadError.new, Nokogiri::XML(payload).errors if Nokogiri::XML(payload).errors.any?
      request 'POST', path, { body: payload }.merge(additional_options)
    end
770519
private void addPostParams(final Request request) {
        if (data != null) {
            request.addPostParam("Data", Converter.mapToJson(data));
        }

        if (ttl != null) {
            request.addPostParam("Ttl", ttl.toString());
        }

        if (itemTtl != null) {
            request.addPostParam("ItemTtl", itemTtl.toString());
        }

        if (collectionTtl != null) {
            request.addPostParam("CollectionTtl", collectionTtl.toString());
        }
    }
274276
private void addPostParams(final Request request) {
        if (roleSid != null) {
            request.addPostParam("RoleSid", roleSid);
        }

        if (attributes != null) {
            request.addPostParam("Attributes", attributes);
        }

        if (friendlyName != null) {
            request.addPostParam("FriendlyName", friendlyName);
        }
    }
1081796
def post(self, path, payload):
        """"""
        body = json.dumps(payload)
        return self._request(path, 'POST', body)
453394
public Optional<Response> POST(String partialUrl, Object payload)
    {    
        URI uri = buildUri(partialUrl);   
        return executePostRequest(uri, payload);
    }
211165
private void addPostParams(final Request request) {
        if (key != null) {
            request.addPostParam("Key", key);
        }

        if (value != null) {
            request.addPostParam("Value", value);
        }
    }
1284142
private <T> PubsubFuture<T> requestJavaNet(final String operation, final HttpMethod method, final String path,
      final Object payload, final ResponseReader<T> responseReader) {

    final HttpRequestFactory requestFactory = transport.createRequestFactory();

    final String uri = baseUri + path;

    final HttpHeaders headers = new HttpHeaders();
    final HttpRequest request;
    try {
      request = requestFactory.buildRequest(method.getName(), new GenericUrl(URI.create(uri)), null);
    } catch (IOException e) {
      throw Throwables.propagate(e);
    }

    headers.setAuthorization("Bearer " + accessToken);
    headers.setUserAgent("Spotify");

    final long payloadSize;
    if (payload != NO_PAYLOAD) {
      final byte[] json = gzipJson(payload);
      payloadSize = json.length;
      headers.setContentEncoding(GZIP);
      headers.setContentLength((long) json.length);
      headers.setContentType(APPLICATION_JSON_UTF8);
      request.setContent(new ByteArrayContent(APPLICATION_JSON_UTF8, json));
    } else {
      payloadSize = 0;
    }

    request.setHeaders(headers);

    final RequestInfo requestInfo = RequestInfo.builder()
        .operation(operation)
        .method(method.toString())
        .uri(uri)
        .payloadSize(payloadSize)
        .build();

    final PubsubFuture<T> future = new PubsubFuture<>(requestInfo);

    executor.execute(() -> {
      final HttpResponse response;
      try {
        response = request.execute();
      } catch (IOException e) {
        future.fail(e);
        return;
      }

      // Return null for 404'd GET & DELETE requests
      if (response.getStatusCode() == 404 && method == HttpMethod.GET || method == HttpMethod.DELETE) {
        future.succeed(null);
        return;
      }

      // Fail on non-2xx responses
      final int statusCode = response.getStatusCode();
      if (!(statusCode >= 200 && statusCode < 300)) {
        future.fail(new RequestFailedException(response.getStatusCode(), response.getStatusMessage()));
        return;
      }

      if (responseReader == VOID) {
        future.succeed(null);
        return;
      }

      try {

        future.succeed(responseReader.read(ByteStreams.toByteArray(response.getContent())));
      } catch (Exception e) {
        future.fail(e);
      }
    });

    return future;
  }
812768
protected int addPayload(RequestBuilder builder, String payload) {
    if (payload == null || payload.length() == 0) {
      return 0;
    }


    builder.setHeader(HttpHeaders.CONTENT_TYPE, contentType.getMimeType());
    builder.setEntity(new StringEntity(payload, contentType));
    return payload.length();
  }