に。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.
AUTHストリング
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.
源泉:CORSを有効にするには、サービスプロバイダまでHere
その、しかし、あなたは(それを回避ハッキングを試みることができる方法がありますしかしそれはかなりではない)。 Meteorメソッド内からサーバーから呼び出しを行い、Meteorクライアントコードからメソッドを呼び出すことをお勧めします。簡単で、簡単で、簡単です。 – jordanwillis