头可以使用。调用HTTP的功能,并通过你的头在选项:
HTTP.call(method, url, [options], [asyncCallback])
参数
方法字符串
The HTTP method to use, such as "GET", "POST", or "HEAD".
URL字符串
The URL to retrieve.
的AsyncCallback功能
Optional callback. If passed, the method runs asynchronously, instead of synchronously, and calls asyncCallback. On the client, this callback is required.
选项
内容字符串
String to use as the HTTP request body.
数据对象
JSON-able object to stringify and use as the HTTP request body. Overwrites content.
查询字符串
Query string to go in the URL. Overwrites any query string in url.
PARAMS对象
Dictionary of request parameters to be encoded and placed in the URL (for GETs) or request body (for POSTs). If content or data is specified, params will always be placed in the URL.
权威性字符串
HTTP basic authentication string of the form "username:password"
头对象
Dictionary of strings, headers to add to the HTTP request.
超时数
Maximum time in milliseconds to wait for the request before failing. There is no timeout by default.
followRedirects布尔
If true, transparently follow HTTP redirects. Cannot be set to false on the client. Default true.
npmReq uestOptions对象
On the server, HTTP.call is implemented by using the npm request module. Any options in this object will be passed directly to the request invocation.
beforeSend功能
On the client, this will be called before the request is sent to allow for more direct manipulation of the underlying XMLHttpRequest object, which will be passed as the first argument. If the callback returns false, the request will be not be send.
周守军:Here
其到服务提供商以启用CORS,但也有方法,你可以尝试破解它周围(但它不漂亮)。我建议你只需从Meteor方法中的服务器执行你的调用,然后从你的Meteor客户端代码中调用该方法。简单,简单,直接。 – jordanwillis