What is the most useful way to make call of an HTTP api remote service using Meteor

I’.m making call of HTTP api after adding http package…
but I’m getting an Error saying Internal Server Error [500].
again n again…

so plzz if u anyone can give me the most promising and useful solution to call the HTTP.call() method…

So … can we see your code?

Yupp… sure…!!
here this is…

I wanna get list of any user’s Instagram followers’ list…

client.js

Template.myTmpl.helpers({
	follower: function() {
		var object  = Meteor.users.findOne(Meteor.userId(), {});
		var access_token = object.services.instagram.accessToken;
		Meteor.call('check_insta', access_token, Meteor.userId(), function(err, rslt) {
			if(err) {
				console.log(err);
			} else {
				Session.set('abc', rslt);
			}
		});
		return Session.get('abc');
	}
});

and this is server side code…

Meteor.methods({
	check_insta: function(token, userId) {
		this.unblock();
		var url = 'https://api.instagram.com/v1/users/'+ userId +'/followed-by?access_token='+ token +'&count=-1';
		var result = HTTP.get(url);
		if(result.statusCode==200) {
			var respJson = JSON.parse(result.content);
		       console.log("response. "+respJson);
		       return respJson;
			
		} else {
                    console.log("response issue: "+result.content);
		    var errorJson = JSON.parse(result.content);
		    throw new Meteor.Error(result.statusCode, errorJson.error);
		}
	}
});

Did you console.log(url) before you make your HTTP.get call to make sure the URL looks okay?

Yupp… that’s perfect…!!

By perfect you mean that if you access the built URL outside of Meteor, say directly in a browser window, you don’t get a 500 response? Can you attach a screenshot of the exact response you’re seeing in your browser console when you try to connect via your method?

actually not…

Actually…
I’m new to Meteor…
so plzz if anyone give the solution to call http api…!!

As shown in your screenshot, this doesn’t really have anything to do with Meteor. If the URL isn’t working when you access it directly then it’s a problem with the URL (since this is a GET request). I’d recommend double checking that you’re using the Instagram API properly.

Actually, taking another quick look at your code - you’re trying to pass a Meteor.userId() to Instagram. Instagram won’t know anything about this user ID. You’ll need to pass in the appropriate Instagram user ID.