I always get an error from retrofit (gson):
retrofit.RetrofitError:com.google.gson.stream.MalformedJsonException:
Use JsonReader.setLentient(true) to accept malformed JSON at line 1
column 15 path $
But in my opinion my return is right. It worked on my local server, but as I uploaded to webspace I always get this :/ In the case below I sent a JSONObject in form of {"string":"test"} and the webservice just returns it (and the answer actually reaches the device, but retrofit throws the error above). The relevant Logs from Retrofit:
---> HTTP POST http://mywebserver.net/set_string.php
Content-Type: application/json
Content-Length: 19
{"string":"test"}
---> END HTTP (19-byte body)
<--- HTTP 200 http://mywebserver.net/set_string.php (351ms)
HTTP/1.1 200 OK
Connection: close
Content-Length: 188
Content-Type: application/json
Date: Tue, 26 May 2015 12:11:40 GMT
Server: Apache
X-Android-Received-Millis: 1432642297627
X-Android-Response-Source: NETWORK 200
X-Android-Sent-Millis: 1432642297438
X-Powered-By: PHP/5.2.17
{"string":"test"}
<!-- Hosting24 Analytics Code -->
<script type="text/javascript"
src="http://stats.hosting24.com/count.php"></script>
<!-- End Of Analytics Code -->
<--- END HTTP (188-byte body)
Thanks for your help in advance!