Как я могу вызвать методы PHP REST-подобного сервиса из asp.net mvc? - PullRequest
0 голосов
/ 19 марта 2012

У меня есть REST-подобный PHP-сервис, и я не понимаю, как вызвать функцию этого сервиса из asp.net mvc. Кто-нибудь может помочь?

1 Ответ

1 голос
/ 19 марта 2012

Вы изучили RestSharp?

Это делает вызов RESTful API очень простым.T Пример из их документации для получения временной шкалы в твиттере:

// 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);
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...