var response = await Http.Get("www.google.com");
Console.WriteLine(response.Text);
public class HttpBinJsonResponse
{
public string Url;
}
var customHeaders = new Dictionary<string, string>
{
{"Test", "header"}
};
var queryParameters = new Dictionary<string, string>
{
{"Query", "param"}
};
var jsonContent = new {Test = "Json"};
var responses = new[]
{
await Http.Get("https://httpbin.org/get", customHeaders: customHeaders, queryParameters: queryParameters),
await Http.PostJson("https://httpbin.org/post", jsonContent, customHeaders: customHeaders, queryParameters: queryParameters),
await Http.PutJson("https://httpbin.org/put", jsonContent, customHeaders: customHeaders, queryParameters: queryParameters),
await Http.Delete("https://httpbin.org/delete", customHeaders: customHeaders, queryParameters: queryParameters)
};
foreach (var response in responses)
{
var responseJson = response.Json<HttpBinResponse>();
}
Note: Use this for testing purposes only.
var response = await Http.Get("https://self-signed.badssl.com", verifySsl: false);
Console.WriteLine(response.Text);