# Payload is empty when making HTTP POST request with HttpConnector

**URL:** <https://forum.camunda.io/t/payload-is-empty-when-making-http-post-request-with-httpconnector/1100>\
**Category:** Discussion & Questions\
**Tags:** process-engine\
**Created:** [July 13, 2016, 9:10pm UTC](https://forum.camunda.io/t/payload-is-empty-when-making-http-post-request-with-httpconnector/1100 "2016-07-13T21:10:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keit\_Adamson](https://forum.camunda.io/letter_avatar_proxy/v4/letter/k/9de053/32.png) [@Keit\_Adamson](https://forum.camunda.io/u/Keit_Adamson)\
**Post date:** [July 13, 2016, 9:10pm UTC](https://forum.camunda.io/t/payload-is-empty-when-making-http-post-request-with-httpconnector/1100/1 "2016-07-13T21:10:53Z")

</div>

I am trying to make a HTTP request with Camunda’s HTTP Connector, but payload is not sent. When I am using OkHttp framework for the same request, payload is delivered. What could be the issue in case of HTTP Connector?

The method’s I am using are following:

```
  public void postExampleWithHttpConnector() {
	  HttpConnector http = Connectors.getConnector(HttpConnector.ID);

	  HttpResponse response = http.createRequest()
	  .post()
	  .contentType("application/json")
	  .payload("{\"jsonrpc\":\"2.0\",\"method\":\"changeDetail\"}")
	  .url("http://posttestserver.com/post.php")
	  .execute();
	  		  
	  System.out.println(response.getResponse());
	  
	  response.close();		  
  }

public void postExampleWithOkHttpClient() {
	OkHttpClient client = new OkHttpClient();

	MediaType mediaType = MediaType.parse("application/json");
	RequestBody body = RequestBody.create(mediaType, "{\"jsonrpc\":\"2.0\",\"method\":\"changeDetail\"}");
	Request request = new Request.Builder()
	  .url("http://posttestserver.com/post.php")
	  .post(body)
	  .addHeader("content-type", "application/json")
	  .build();

	try {
	Response response = client.newCall(request).execute();
	System.out.println(response.body().string());
	response.close();
	} catch (Exception exception) {
		System.out.println(exception.getMessage());
	}
}
```

---

<div class="post-metadata">

**Author:** ![menski](https://forum.camunda.io/user_avatar/forum.camunda.io/menski/32/17_2.png) [@menski](https://forum.camunda.io/u/menski)\
**Post date:** [July 15, 2016, 11:14am UTC](https://forum.camunda.io/t/payload-is-empty-when-making-http-post-request-with-httpconnector/1100/2 "2016-07-15T11:14:16Z")

</div>

Hi,

the body sent by the Camunda Connect code is not empty. But the service you use does not record the body. I assume this is caused by the fact that the Camunda Connect request uses the Transfer-Encoding: chunked. This means the body is transferred as chunks and the content length is not set in the request header. Probably your test service only records bodies with a known content length.

Cheers,  
Sebastian

---

<div class="post-metadata">

**Author:** ![system](https://forum.camunda.io/uploads/default/original/3X/5/8/58d50142eacca605d35cb1ef9e6b86ae85f49436.png) [@system](https://forum.camunda.io/u/system)\
**Post date:** [January 30, 2024, 10:38am UTC](https://forum.camunda.io/t/payload-is-empty-when-making-http-post-request-with-httpconnector/1100/3 "2024-01-30T10:38:07Z")

</div>

Closed on January 30, 2024, 10:38am UTC


