For reasons I don’t understand, the java server I am using barfs on the charset=XXX part of the content-type header, which appears to be automatically appended by Gatling.
I end up getting java.lang.ClassCastException
Is there any way of suppressing the charset=XXX part of the content-type header?
Here are a couple of curl commands that show what happens when have and don’t have the charset=XXX in the content-type header:
WITH charset=XXX:
$ curl -v -H ‘Accept: application/json’ -H ‘content-type: application/json; charset=utf-8’ -H ‘x-Ayla-auth-key: Ayla1.0 e8fCIQLJGd8fqu36pCPraicxrQl5LH5by5Dm’ -d ‘{“datapoint”: {“value”: “LvubYAu34”}}’ ‘http://staging-pub-ext.ayladev.com/devices/851971/properties/f018/datapoints?bridgeEndpoint=true&throwExceptionOnFailure=false©Headers=false&maxTotalConnections=875&connectionsPerRoute=875’
-
Trying 54.84.122.130…
-
Connected to staging-pub-ext.ayladev.com (54.84.122.130) port 80 (#0)
POST /devices/851971/properties/f018/datapoints?bridgeEndpoint=true&throwExceptionOnFailure=false©Headers=false&maxTotalConnections=875&connectionsPerRoute=875 HTTP/1.1
User-Agent: curl/7.43.0
Accept: application/json
content-type: application/json; charset=utf-8
x-Ayla-auth-key: Ayla1.0 e8fCIQLJGd8fqu36pCPraicxrQl5LH5by5Dm
Content-Length: 37
- upload completely sent off: 37 out of 37 bytes
< HTTP/1.1 500 Server Error
< Date: Fri, 19 Oct 2018 14:54:39 GMT
< Content-Type: text/plain;charset=iso-8859-1
< Transfer-Encoding: chunked
< Connection: keep-alive
< Server: Jetty(9.4.11.v20180605)
<
java.lang.ClassCastException
- Connection #0 to host staging-pub-ext.ayladev.com left intact
WITHOUT charset=XXX:
$ curl -v -H ‘Accept: application/json’ -H ‘content-type: application/json’ -H ‘x-Ayla-auth-key: Ayla1.0 e8fCIQLJGd8fqu36pCPraicxrQl5LH5by5Dm’ -d ‘{“datapoint”: {“value”: “LvubYAu34”}}’ ‘http://staging-pub-ext.ayladev.com/devices/851971/properties/f018/datapoints?bridgeEndpoint=true&throwExceptionOnFailure=false©Headers=false&maxTotalConnections=875&connectionsPerRoute=875’
-
Trying 34.226.30.241…
-
Connected to staging-pub-ext.ayladev.com (34.226.30.241) port 80 (#0)
POST /devices/851971/properties/f018/datapoints?bridgeEndpoint=true&throwExceptionOnFailure=false©Headers=false&maxTotalConnections=875&connectionsPerRoute=875 HTTP/1.1
User-Agent: curl/7.43.0
Accept: application/json
content-type: application/json
x-Ayla-auth-key: Ayla1.0 e8fCIQLJGd8fqu36pCPraicxrQl5LH5by5Dm
Content-Length: 37
- upload completely sent off: 37 out of 37 bytes
< HTTP/1.1 200 OK
< Date: Fri, 19 Oct 2018 15:02:36 GMT
< Content-Type: application/json
< Content-Length: 0
< Connection: keep-alive
< Accept: application/json
< breadcrumbId: ID-pub-2167-stage-ayladev-net-1539938278985-0-4272536
< bridgeEndpoint: true
< connectionsPerRoute: 875
< copyHeaders: false
< maxTotalConnections: 875
< throwExceptionOnFailure: false
< User-Agent: curl/7.43.0
< X-Amzn-Trace-Id: Root=1-5bc9f20c-5290be513150f608a921e0a3
< x-Ayla-auth-key: Ayla1.0 e8fCIQLJGd8fqu36pCPraicxrQl5LH5by5Dm
< X-Forwarded-For: 12.1.79.146
< X-Forwarded-Port: 80
< X-Forwarded-Proto: http
< Server: Jetty(9.4.11.v20180605)
<
- Connection #0 to host staging-pub-ext.ayladev.com left intact
- Ron