I have a REST-like PHP service and i don't understand how invoke function of this service from asp.net mvc. Can anybody help?
2
-
Not with me having left my psychic hat at home today. Darn it! Please provide some sort of information as to how you expect us to figure it out for you with no documentation whatsoever...DaveRandom– DaveRandom2012-03-19 16:01:46 +00:00Commented Mar 19, 2012 at 16:01
-
What kind of intormation you want? I have third-party php service and mvc project:) That's all.Ilya Shpakovsky– Ilya Shpakovsky2012-03-19 16:50:16 +00:00Commented Mar 19, 2012 at 16:50
Add a comment
|
1 Answer
Have you looked into RestSharp?
It makes calling RESTful API's very easy. The example from their documentation for getting a twitter timeline:
// Create the client
var client = new RestClient();
// Set the service url
client.BaseUrl = "http://twitter.com";
// Set an optional authentication
client.Authenticator = new HttpBasicAuthenticator("username", "password");
// Create the request
var request = new RestRequest();
// The request is relative to the client base url
request.Resource = "statuses/friends_timeline.xml";
// Execute the request - the data is stored in the response.
RestResponse response = client.Execute(request);