2012-06-27 18 views
2

我建立一些數據提交給我們使用第三方服務Web服務請求:如何設置Play的POST標題! 2.0 webservice查詢?

val promise = WS.url("http://example.com/api/xxx/testers?api_key=%s" format(prefineryAPIKey)).post(requestBody) 
val data = promise.value.get.body 

變量requestBody是XML內容,我需要發這個帖子與"Content-Type: text/xml"。我如何在web服務中設置它?它是否像Play!的結果鏈接.as("text/xml")

謝謝

回答