title: How to unmarshall `text/plain` as JSON in Akka HTTP
body: <p>I'm working with a legacy HTTP API (that I can't change) that responds with JSON in the body, but gives a <code>Content-Type: text/plain; charset=utf-8</code> header.</p>
  
  <p>I am attempting to unmarshall that HTTP body as JSON, but I get the following exception: <code>akka.http.scaladsl.unmarshalling.Unmarshaller$UnsupportedContentTypeException: Unsupported Content-Type, supported: application/json</code></p>
  
  <p>My code looks like this:</p>
  
  <pre><code>import spray.json.DefaultJsonProtocol
  import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
  import akka.http.scaladsl.unmarshalling._
  
  case class ResponseBody(status: String, error_msg: String)
  
  object ResponseBodyJsonProtocol extends DefaultJsonProtocol {
    implicit val responseBodyFormat = jsonFormat2(ResponseBody)
  }
  
  def parse(entity: HttpEntity): Future[ResponseBody] = {
    implicit val materializer: Materializer = ActorMaterializer()
    import ResponseBodyJsonProtocol._
    Unmarshal[HttpEntity](entity).to[ResponseBody]
  }
  </code></pre>
  
  <p>A sample HTTP response looks like this:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Cache-Control: private
  Content-Encoding: gzip
  Content-Length: 161
  Content-Type: text/plain; charset=utf-8
  Date: Wed, 16 Dec 2015 18:15:14 GMT
  Server: Microsoft-IIS/7.5
  Vary: Accept-Encoding
  X-AspNet-Version: 4.0.30319
  X-Powered-By: ASP.NET
  
  {"status":"1","error_msg":"Missing parameter"}
  </code></pre>
  
  <p>What can I do to ignore the <code>Content-Type</code> in the HTTP response and parse as JSON?</p>