samedi 25 avril 2015

Get information from a website using Json/Ajax in c#


I need some urgently help. At first:

I'am working on a school project. I need to send parameters to a website with API and get response. than I have to show the User the result of the webrequest as aa table.

The website has a documentation which shows how to get informations from there. And here is an example which I copy from the website.

$.ajax({
    url: "http://ift.tt/1z5H1sJ",
    jsonp: "callback",
    dataType: "jsonp",
    data: {
        lat: position.coords.latitude,
        lng: position.coords.longitude,
        rad: 5,
        sort: "price",
        type: "diesel",
        apikey: "00000000-0000-0000-0000-000000000001"
    },
    success: function(data) {
        console.log(data);
        display(data);
    }
});

What I have to do now is to send this "request" in c# (Windows forms) to the website. How could I realize that ???


Aucun commentaire:

Enregistrer un commentaire