Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 Titanium.Network.Socket.TCP 从远程服务器下载图像文件。服务器需要header/cookies,如何设置cookies?
在 HTTP 请求中,您可以使用方法setRequestHeader来包含您的标头信息。
例如:
xhr.setRequestHeader("X-Auth-Token", "foobar");
文档:http ://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Network.HTTPClient-method-setRequestHeader