Mashape API help

I am quite new to Meteor and I am building an app that will utilize an API provided through Mashape. I am aware of this:

 Meteor.methods({checkTwitter: function (userId) {
      check(userId, String);
      try {
        var result ="GET", "",
                               {params: {user: userId}});
        return true;
      } catch (e) {
        // Got a network error, time-out or HTTP error in the 400 or 500 range.
        return false;

But I don’t know how to replicate this while passing in (for example) the api key.

The jquery way is quite simple for me, but meteor provides functionality for this and I am cutting back on my jquery crutch and am confused here.

Any help would be killer

jquery example:

    url: '', // The URL to the API. You can get this in the API page of the API you intend to consume
    type: 'GET', // The HTTP Method, can be GET POST PUT DELETE etc
    data: {}, // Additional parameters here
    datatype: 'json',
    success: function(data) { console.dir((data.source)); },
    error: function(err) { alert(err); },
    beforeSend: function(xhr) {
    xhr.setRequestHeader("X-Mashape-Authorization", "YOUR-MASHAPE-KEY"); // Enter here your Mashape key

so do you basically want to pass additional parameters to that http call?
if it is the case, you just need to add it in your params.
like that:

params = {
q: search,
api_key: key

1 Like

You can pass parameters to the HTTP.get() in the command string itself, or as the params property of the options object as @stanp says. So:

var result ="GET", ""+userId+"&apiKey=abc123");


var result ="GET", "", {
  query: {
    user: userId,
    apiKey: "abc123"


1 Like

Thanks for the help!

It was the request headers & problem solved.