Version: 0.7.0
Scala Version: 2.12.16
Steps to replicate:
scala> import gigahorse._, support.apachehttp.Gigahorse
import gigahorse._
import support.apachehttp.Gigahorse
scala> Gigahorse.http(Gigahorse.config).run(Gigahorse.url("https://example.com").withContentType(MimeTypes.JSON, Gigahorse.utf8).post("foo"))
java.lang.IllegalArgumentException: MIME type may not contain reserved characters
at gigahorse.shaded.apache.org.apache.http.util.Args.check(Args.java:36)
at gigahorse.shaded.apache.org.apache.http.entity.ContentType.create(ContentType.java:229)
at gigahorse.shaded.apache.org.apache.http.entity.ContentType.create(ContentType.java:241)
at gigahorse.support.apachehttp.ApacheHttpClient.buildContentType$1(ApacheHttpClient.scala:106)
at gigahorse.support.apachehttp.ApacheHttpClient.ct$1(ApacheHttpClient.scala:112)
at gigahorse.support.apachehttp.ApacheHttpClient.buildProducer$1(ApacheHttpClient.scala:121)
at gigahorse.support.apachehttp.ApacheHttpClient.buildRequestProducer(ApacheHttpClient.scala:127)
at gigahorse.support.apachehttp.ApacheHttpClient.buildRequest(ApacheHttpClient.scala:79)
at gigahorse.support.apachehttp.ApacheHttpClient.processFull(ApacheHttpClient.scala:158)
at gigahorse.support.apachehttp.ApacheHttpClient.run(ApacheHttpClient.scala:66)
... 54 elided
Version:
0.7.0
Scala Version:2.12.16
Steps to replicate:I believe this may due to https://github.com/eed3si9n/gigahorse/blob/efc2e8e595f959e8b3ee02ec4b11a9d930a19162/apache-http/src/main/scala/gigahorse/support/apachehttp/ApacheHttpClient.scala#L106 calling
ContentType.create(value)
that will contain;
splitting the charset while it should instead be callingContentType.create(mimeType, charset)
?Thanks in advance to reviewing this issue!