How To Call Django REST API in my meteor app?


#1

I am just doing an exercise where I need to use meteor as a front end framework only. I am not able to fetch data in JSON from my Django REST API. How can I do that? So, I would be able to show my Django app’s data through meteor templates.
Everybody is saying to use HTTP.get but I’m not clear how to use it? I am very new to meteor and any help would be appreciated as I am trying to find this solution from past 2 days.

Thanks


#2

Here is the spec according to the documentation. I also happen to have an api call to the slack api just hanging around so you can look at this and see if it’s of any use.

HTTP.get("https://slack.com/api/chat.postMessage", {
            params: {
                token: accessToken,
                channel: channelId,
                text: text,
                link_names:true,
                username: username
            }
        }, function(err, message) {
            if(err) {
                console.log(err);
            } else if(!message.data.ok){
                console.log(message);
            } else {
              // success!
            }
        })