1
當試圖發送一個xml內容類型的MIME頭噴霧設置內容類型的XML
sender ! HttpResponse(status = 200, entity = responseBody, headers = List(`Content-Type`(`text/xml`)))
我得到的錯誤:
not found: value text/xml
我的應用程序/ XML裏面也沒有試過工作要麼應用程序/ JSON的作品FWIW
是否有一些進口缺失?
編輯:試圖添加此
import spray.http.MediaTypes._
sender ! HttpResponse(status = 400, entity = responseBody, headers = List(`Content-Type`(`application/xml`)))
這給了以下錯誤:
Explicitly set response header 'Content-Type: application/xml' is
ignored, the response Content-Type is set via the response's HttpEntity!