简体   繁体   English

至于flex http请求,如何在包含特殊字符时设置标头属性

[英]as for a flex http request, how to set the header attributes when special characters are contained

My task is to call some api in flex, and I use HTTPService to send a request to the server. 我的任务是在flex中调用一些api,然后使用HTTPService将请求发送到服务器。 It must be authenticated if I want to retrieve any data from the server. 如果要从服务器检索任何数据,则必须进行身份验证。 The authentication information are put in the headers of a request. 身份验证信息放在请求的标头中。 Now the problem is if the attribute contains some special characters (a colon for instance), then the request won't work, which means the authentication failed. 现在的问题是,如果属性包含一些特殊字符(例如冒号),则请求将无法正常工作,这意味着身份验证失败。 Actually this attribute is then neglected. 实际上,此属性随后被忽略。 Is some encoding needed when setting those attributes? 设置这些属性时是否需要一些编码?

// this attribute will be negelected, for colons are contained in it.
http.headers["X-wsse"] = "Created=\"2013-01-02T11:29:13+01:00\""; 

Colon isn't special in HTTP header field values. 冒号在HTTP标头字段值中并不特殊。

You may want to check the documentation of "X-wsse" (whatever that is). 您可能要检查“ X-wsse”的文档(无论如何)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM