ASP.NET MVC request forwarder

99 views Asked by At

I would like to achieve this kind of functionality:

When a client makes GET request to

GET http://www.myserviceurl.com/rest/facebook/profile/me

to get response from

GET http://graph.facebook.com/profile/me

Application logic will append all nessesary parameters so the final url will look like:

graph.facebook.com/profile/me?access_token=XXX

Similar,

POST myserviceurl.com/rest/twitter/statuses/update.json with post data status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk&trim_user=true&include_entities=true

->

POST api.twitter.com/1/statuses/update.json with POST data status=Maybe%20he%27ll%20finally%20find%20his%20keys.%20%23peterfalk&trim_user=true&include_entities=true

This way I want to create a layer of apstraction and allow my clients to invoke my rest service using the same structure of provider rest url.

What will be a recommended approach?

1

There are 1 answers

0
lucask On

Maybe You could use Facebook C# SDK (which is basically a wrapper for Facebook Graph API) to fetch json data from Facebook and return it to Your users.