title: muutanja error in aws server and not in localhost
body: <p>Hopefully it makes sense to make a question like this here:</p>
  
  <p>I have an python3 api which it uses Flask to serve. I also have an clojure app that makes a post request targeting the python3 api. To do so I use <a href="https://github.com/dakrone/clj-http" rel="nofollow noreferrer">clj-http</a> with something like:</p>
  
  <pre><code>(client/post url-link
               {:basic-auth ["username"
                             "password"]
                :form-params json
                :content-type :json})
  </code></pre>
  
  <p>Now, when I test in my machine serving the python3 api locally, i.e, </p>
  
  <pre><code>(def url-link "localhost:port/api-name")
  </code></pre>
  
  <p>it works smoothly. The issue comes because I will serve the python3 api from the amazon server. So my thought was to use the link of the amazon server. But when I do so, clojure complains with </p>
  
  <pre><code>HTTP ERROR 500 clojure.lang.ExceptionInfo: Malformed application/json in :muuntaja/encode {:type :muuntaja/encode, :format "application/json"}
  URI:    /api/sell-call
  STATUS: 500
  MESSAGE:    clojure.lang.ExceptionInfo: Malformed application/json in :muuntaja/encode {:type :muuntaja/encode, :format "application/json"}
  SERVLET:    -
  CAUSED BY:  clojure.lang.ExceptionInfo: Malformed application/json in :muuntaja/encode {:type :muuntaja/encode, :format "application/json"}
  CAUSED BY:  com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.UnsupportedOperationException) (through reference chain: clojure.lang.PersistentArrayMap[":full_message"]-&gt;clojure.lang.ExceptionInfo["data"]-&gt;clojure.lang.PersistentHashMap[":http-client"]-&gt;org.apache.http.impl.client.InternalHttpClient["params"])
  CAUSED BY:  java.lang.UnsupportedOperationException
  clojure.lang.ExceptionInfo: Malformed application/json in :muuntaja/encode {:type :muuntaja/encode, :format "application/json"}
      at muuntaja.core$on_exception.invokeStatic(core.clj:284)
      at muuntaja.core$on_exception.invoke(core.clj:267)
      at clojure.core$partial$fn__5824.invoke(core.clj:2626)
      at muuntaja.core$create_coder$encode__10562.invoke(core.clj:346)
      at clojure.core$update.invokeStatic(core.clj:6198)
      at clojure.core$update.invoke(core.clj:6188)
      at muuntaja.core$create$_handle_response__10629.invoke(core.clj:443)
      at muuntaja.core$create$reify__10631.format_response(core.clj:486)
      at muuntaja.middleware$wrap_format_response$fn__10702.invoke(middleware.clj:132)
      at muuntaja.middleware$wrap_format_negotiate$fn__10695.invoke(middleware.clj:96)
      at ring.middleware.keyword_params$wrap_keyword_params$fn__9403.invoke(keyword_params.clj:53)
      at ring.middleware.nested_params$wrap_nested_params$fn__9461.invoke(nested_params.clj:89)
      at ring.middleware.params$wrap_params$fn__9535.invoke(params.clj:67)
      at compojure.api.middleware$wrap_inject_data$fn__11689.invoke(middleware.clj:96)
      at compojure.api.routes.Route.invoke(routes.clj:89)
      at ring.middleware.basic_authentication$wrap_basic_authentication$fn__16405.invoke(basic_authentication.clj:157)
      at clojure.lang.Var.invoke(Var.java:384)
      at ring.middleware.reload$wrap_reload$fn__1065.invoke(reload.clj:39)
      at ring.adapter.jetty$proxy_handler$fn__480.invoke(jetty.clj:27)
      at ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle(Unknown Source)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      at org.eclipse.jetty.server.Server.handle(Server.java:500)
      at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
      at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
      at java.base/java.lang.Thread.run(Thread.java:834)
  Caused by: com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.UnsupportedOperationException) (through reference chain: clojure.lang.PersistentArrayMap[":full_message"]-&gt;clojure.lang.ExceptionInfo["data"]-&gt;clojure.lang.PersistentHashMap[":http-client"]-&gt;org.apache.http.impl.client.InternalHttpClient["params"])
      at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:394)
      at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:353)
      at com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:316)
      at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:727)
      at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:722)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:643)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33)
      at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727)
      at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:719)
      at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:722)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:643)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33)
      at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
      at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
      at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3905)
      at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsBytes(ObjectMapper.java:3243)
      at jsonista.core$write_value_as_bytes.invokeStatic(core.clj:229)
      at jsonista.core$write_value_as_bytes.invoke(core.clj:221)
      at muuntaja.format.json$encoder$reify__10016.encode_to_bytes(json.clj:43)
      at muuntaja.core$create_coder$encode__10562.invoke(core.clj:344)
      ... 28 more
  Caused by: java.lang.UnsupportedOperationException
      at org.apache.http.impl.client.InternalHttpClient.getParams(InternalHttpClient.java:211)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:688)
      at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:719)
      ... 46 more
  com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.UnsupportedOperationException) (through reference chain: clojure.lang.PersistentArrayMap[":full_message"]-&gt;clojure.lang.ExceptionInfo["data"]-&gt;clojure.lang.PersistentHashMap[":http-client"]-&gt;org.apache.http.impl.client.InternalHttpClient["params"])
      at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:394)
      at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:353)
      at com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:316)
      at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:727)
      at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:722)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:643)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33)
      at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727)
      at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:719)
      at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:722)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:643)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33)
      at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
      at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
      at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3905)
      at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsBytes(ObjectMapper.java:3243)
      at jsonista.core$write_value_as_bytes.invokeStatic(core.clj:229)
      at jsonista.core$write_value_as_bytes.invoke(core.clj:221)
      at muuntaja.format.json$encoder$reify__10016.encode_to_bytes(json.clj:43)
      at muuntaja.core$create_coder$encode__10562.invoke(core.clj:344)
      at clojure.core$update.invokeStatic(core.clj:6198)
      at clojure.core$update.invoke(core.clj:6188)
      at muuntaja.core$create$_handle_response__10629.invoke(core.clj:443)
      at muuntaja.core$create$reify__10631.format_response(core.clj:486)
      at muuntaja.middleware$wrap_format_response$fn__10702.invoke(middleware.clj:132)
      at muuntaja.middleware$wrap_format_negotiate$fn__10695.invoke(middleware.clj:96)
      at ring.middleware.keyword_params$wrap_keyword_params$fn__9403.invoke(keyword_params.clj:53)
      at ring.middleware.nested_params$wrap_nested_params$fn__9461.invoke(nested_params.clj:89)
      at ring.middleware.params$wrap_params$fn__9535.invoke(params.clj:67)
      at compojure.api.middleware$wrap_inject_data$fn__11689.invoke(middleware.clj:96)
      at compojure.api.routes.Route.invoke(routes.clj:89)
      at ring.middleware.basic_authentication$wrap_basic_authentication$fn__16405.invoke(basic_authentication.clj:157)
      at clojure.lang.Var.invoke(Var.java:384)
      at ring.middleware.reload$wrap_reload$fn__1065.invoke(reload.clj:39)
      at ring.adapter.jetty$proxy_handler$fn__480.invoke(jetty.clj:27)
      at ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle(Unknown Source)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      at org.eclipse.jetty.server.Server.handle(Server.java:500)
      at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
      at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
      at java.base/java.lang.Thread.run(Thread.java:834)
  Caused by: java.lang.UnsupportedOperationException
      at org.apache.http.impl.client.InternalHttpClient.getParams(InternalHttpClient.java:211)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:688)
      at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:719)
      ... 46 more
  java.lang.UnsupportedOperationException
      at org.apache.http.impl.client.InternalHttpClient.getParams(InternalHttpClient.java:211)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:688)
      at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:719)
      at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:722)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:643)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33)
      at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727)
      at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:719)
      at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:722)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:643)
      at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:33)
      at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
      at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
      at com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3905)
      at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsBytes(ObjectMapper.java:3243)
      at jsonista.core$write_value_as_bytes.invokeStatic(core.clj:229)
      at jsonista.core$write_value_as_bytes.invoke(core.clj:221)
      at muuntaja.format.json$encoder$reify__10016.encode_to_bytes(json.clj:43)
      at muuntaja.core$create_coder$encode__10562.invoke(core.clj:344)
      at clojure.core$update.invokeStatic(core.clj:6198)
      at clojure.core$update.invoke(core.clj:6188)
      at muuntaja.core$create$_handle_response__10629.invoke(core.clj:443)
      at muuntaja.core$create$reify__10631.format_response(core.clj:486)
      at muuntaja.middleware$wrap_format_response$fn__10702.invoke(middleware.clj:132)
      at muuntaja.middleware$wrap_format_negotiate$fn__10695.invoke(middleware.clj:96)
      at ring.middleware.keyword_params$wrap_keyword_params$fn__9403.invoke(keyword_params.clj:53)
      at ring.middleware.nested_params$wrap_nested_params$fn__9461.invoke(nested_params.clj:89)
      at ring.middleware.params$wrap_params$fn__9535.invoke(params.clj:67)
      at compojure.api.middleware$wrap_inject_data$fn__11689.invoke(middleware.clj:96)
      at compojure.api.routes.Route.invoke(routes.clj:89)
      at ring.middleware.basic_authentication$wrap_basic_authentication$fn__16405.invoke(basic_authentication.clj:157)
      at clojure.lang.Var.invoke(Var.java:384)
      at ring.middleware.reload$wrap_reload$fn__1065.invoke(reload.clj:39)
      at ring.adapter.jetty$proxy_handler$fn__480.invoke(jetty.clj:27)
      at ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$ff19274a.handle(Unknown Source)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      at org.eclipse.jetty.server.Server.handle(Server.java:500)
      at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:386)
      at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:562)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:378)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
      at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
      at java.base/java.lang.Thread.run(Thread.java:834)
  Powered by Jetty:// 9.4.22.v20191022
  </code></pre>
  
  <p>So, is it possible to say what I am doing wrong? Is there a way to work around it from the client side?</p>
  
  <p><strong>Note:</strong> The problem is that this is a code from my work and I would like to not share much of the specifics from it. I am asking because maybe I am missing a simple solution. If this question does not make sense to be in here, let me know and I will delete it.</p>
  
  <p>I appreciate any help!</p>