以下代碼在CF10上正常工作。cfhttp返回415 CF9上不受支持的介質類型
httpSvc = New http();
httpSvc.setMethod("post");
httpSvc.setCharset("utf-8");
httpSvc.setUrl(svcLocation);
httpSvc.setClientCert(certLocation);
httpSvc.setClientCertPassword(certPassword);
httpSvc.addParam(type="body", name="body",value=requestParameters);
result = httpSvc.send().getPrefix();
requestParameters的值是:
<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:processCreditCard xmlns:ns2="urn:com.qvalent.payway.api">
<requestParameters>customer.orderNumber=5396&card.CVN=070&order.amount=101&customer.merchant=xxxx&card.expiryMonth=08&card.expiryYear=20&order.ECI=SSL&card.PAN=0000000000000008&card.currency=AUD&customer.username=xxxxxx&order.type=capture&customer.password=xxxxxxx</requestParameters>
</ns2:processCreditCard>
</S:Body>
</S:Envelope>
然而,當我把它放在一個CF9服務器上,響應FileContent是空的,我碰到下面的狀態代碼:
415 Unsupported Media Type
以下是顯示完整回覆的鏈接:http://www.onoffezy.com/_testing/gateway/
Trawling G oogle,415狀態碼指出客戶端請求的MIME類型在服務器上不可用。但是我找不到可以爲請求設置MIME類型的任何地方。在cf9和cf10之間,默認的mimetype有沒有區別?
我仔細看過兩個版本的文檔,但找不到可以解釋這個問題的差異。
如果任何人都可以對此有所瞭解,並讓我知道我需要在CF9上做什麼不同,我將非常感激。
非常感謝
很高興你明白了。 – 2013-02-20 13:09:47