# EmonCMS (Ubuntu 16,Apache 2.4, PHP 7) Input POST issue with Java client

**URL:** <https://community.openenergymonitor.org/t/emoncms-ubuntu-16-apache-2-4-php-7-input-post-issue-with-java-client/7600>\
**Category:** Getting Started\
**Tags:** input, feeds, emoncms\
**Created:** [7 June 2018 14:33 UTC](https://community.openenergymonitor.org/t/emoncms-ubuntu-16-apache-2-4-php-7-input-post-issue-with-java-client/7600 "2018-06-07T14:33:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PrimaPower](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/primapower/32/8666_2.png) [@PrimaPower](https://community.openenergymonitor.org/u/PrimaPower)\
**Post date:** [7 June 2018 14:33 UTC](https://community.openenergymonitor.org/t/emoncms-ubuntu-16-apache-2-4-php-7-input-post-issue-with-java-client/7600/1 "2018-06-07T14:33:31Z")

</div>

(Followed the LinuxInstall.md)

If I send an input/post to an [emoncms.org](http://emoncms.org) account with the fulljson in it the response says:

```auto
ok

```

The response header says:

```auto
Connection: close
Content-Length: 2
**Content-Type: application/json**
Date: Thu, 07 Jun 2018 13:24:09 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3.25

```

But if I send exactly the same request an input/post to my local install the response says:

```auto
{"success": true}

```

And the response header says:

```auto
Connection: Keep-Alive
Content-Length: 17
**Content-Type: text**
Date: Thu, 07 Jun 2018 13:48:41 GMT
Keep-Alive: timeout=5, max=95
Server: Apache/2.4.18 (Ubuntu)

```

My Java client uses Spring Resttemplate with:  
headers.setAccept(Arrays.asList(MediaType.TEXT\_HTML, MediaType.APPLICATION\_JSON));

The posting arrives on the server + stored correctly but the client throws an exception:  
org.springframework.http.InvalidMediaTypeException: Invalid mime type “text”: does not contain ‘/’

This is due the ‘text’ Content-Type response.

I already added the json mime type to Apache mime.conf. That did not help.

Is this a EmonsCMS bug/issue?  
Or did I do something wrong?

---

<div class="post-metadata">

**Author:** ![emrys](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/emrys/32/7050_2.png) [@emrys](https://community.openenergymonitor.org/u/emrys)\
**Post date:** [12 June 2018 16:48 UTC](https://community.openenergymonitor.org/t/emoncms-ubuntu-16-apache-2-4-php-7-input-post-issue-with-java-client/7600/2 "2018-06-12T16:48:09Z")

</div>

Hi,  
I’ve added “text/plain” as the “Content-Type” header to this pull request. this should prevent the header parsing errors above.

> <https://github.com/emoncms/emoncms/pull/873>
>
> I'd expect these to be "application/json" not "text/plain"?
> 
> changed in aug '1…7 to "text"
> https://github.com/emoncms/emoncms/commit/0b48caff7ff1cd65db6a95925def141e1a2d3942

thanks @Bill.Thomson for the typo spot!

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [12 June 2018 22:49 UTC](https://community.openenergymonitor.org/t/emoncms-ubuntu-16-apache-2-4-php-7-input-post-issue-with-java-client/7600/3 "2018-06-12T22:49:38Z")

</div>

> [@emrys](#):
>
> thanks @Bill.Thomson for the typo spot!

YVW, S!
