This is some kind of a RestSharp port to PCL.
- Version 2.1.0 is available now!
- Fixes issue #11
- IRestClient now derives from IDisposable
- HttpClient is kept alive until the RestClient gets disposed
- Default HTTP header parameters are set for the HttpClient
- Fixes issue #12
- Workaround for the 32k limit of EscapeDataString
- Custom class for URL encoding that's used as fall-back, when the user wants to use EscapeDataString with a byte array (which isn't supported).
- Avoid rebuilding the Basic Authentication header for each request
- Fixed NuGet dependency for the OAuth 1.0 package
- Fixed some problems found by FxCop
- Fixed NuGet package for Xamarin.iOS (upload using nuget instead of NPE)
- Fixed Microsoft.Bcl and Microsoft.Bcl.Build dependencies
- Assemblies are now CLSCompliant (except PCL and SL5, which don't support this attribute)
- Removed all deprecated methods
- Starting from this version, I'll use Semantic Versioning 2.0.0
- Optimizing NuGet dependencies for several platforms
- Clear Accept HTTP header parameter for the SL5 platform for GET requests (Issue #9)
- Add Deflate encoding
- OAuth2AuthorizationRequestHeaderAuthenticator should only check for Authorization header parameter
- Better handling of refresh tokens in the OAuth2AuthorizationRequestHeaderAuthenticator
- Increased compatibility with the original RestSharp project
- BuildUri instead of BuildUrl (deprecated)
- Added AddJsonBody, AddXmlBody, AddQueryParameter, AddObject
- Graceful handling of duplicate parameters (might be a breaking change)
- Dispose HttpClient, HttpRequestMessage and the HttpResponseMessage
- BuildUrl adds a "/" between a base URL and resource if neither of them is empty and the "/" is missing
- Fix BOM for XmlDataContractSerializer
- Better support for OAuth2 refresh tokens by supporting a HTTP 401 by the OAuth2 authenticator (when a refresh token was set)
- Support for parameters in IRestClient.BaseUrl
- Signed OAuth1/OAuth2 assemblies
- Increased compatibility for empty IRestClient.BaseUrl
- Workaround for NuGet pack bug
- Encodings for parameters (get/post/url/query)
- Async. authenticators
- New OAuth2 package
- Cancellable requests
- New OAuth 1.0 package
- .NET Framework 4
- .NET for Windows Store apps
- .NET Native
- Windows Phone 8 and 8.1
- Silverlight 5
- Portable Class Libraries
The following is an example to get the ticker from the bitstamp.net website.
public class TickerResult
{
public decimal Last { get; set; }
public decimal High { get; set; }
public decimal Low { get; set; }
public decimal Volume { get; set; }
public decimal Bid { get; set; }
public decimal Ask { get; set; }
}
We use the class with:
using (var client = new RestClient(new Uri("https://www.bitstamp.net/api/")))
{
var request = new RestRequest("ticker", HttpMethod.Get);
var result = await client.Execute<TickerResult>(request);
}
The support for community projects can be found in my subreddit /r/FubarDev.
You can get professional support here: Fubar Development Junker