Character encoding Worklight-通过HTTP发送希腊字符
在Worklight中,我试图通过HTTP适配器发送HTTP请求,该适配器包含带希腊字母的参数。然而,采用的编码将希腊字母改为象形文字。有人知道我如何让请求发送希腊字符吗Character encoding Worklight-通过HTTP发送希腊字符,character-encoding,httprequest,ibm-mobilefirst,worklight-adapters,Character Encoding,Httprequest,Ibm Mobilefirst,Worklight Adapters,在Worklight中,我试图通过HTTP适配器发送HTTP请求,该适配器包含带希腊字母的参数。然而,采用的编码将希腊字母改为象形文字。有人知道我如何让请求发送希腊字符吗 var request = '<?xml version="1.0" encoding="UTF-8"?>' + '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' + 'xmlns
var request =
'<?xml version="1.0" encoding="UTF-8"?>'
+ '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" '
+ 'xmlns:test="">'
+ '<soapenv:Header/>'
+ '<soapenv:Body>'
+ '<test:getAnalysis>'
+ '<request>'
+ '<invoiceId>' + invoiceId + '</invoiceId>'
+ '</request>'
+ '</test:getAnalysis>'
+ '</soapenv:Body>'
+ '</soapenv:Envelope>';
var options = {
method : 'post',
returnedContentType : 'xml',
path : getPath(),
body: {
content: request.toString(),
contentType: 'text/xml; charset=utf-8',
},
};
return WL.Server.invokeHttp(options).Envelope.Body;
上述要求很有效。UTF-8是唯一需要的。当我试图通过eclipse调用适配器时,出现了编码问题。通过应用程序调用适配器时,使用正确的编码发送参数。您使用的是什么编码?您是如何应用它的?您能提供一个代码示例吗?我刚刚尝试让HTTP适配器将希腊数据发送到测试服务器,效果很好。你也可以试试。向以下URL发送一篇带有名为data的参数的帖子:@asterix,此问题有任何更新吗?谢谢@asterix。你介意把这写下来作为回答而不是评论吗?