Web functions

Certificate validation

In some cases certificate validation has to be switched off when using self signed certificates is SSL connectivity.

You may use Energy.Core.Web.IgnoreCertificateValidation property to change this setting programatically.

public static bool IgnoreCertificateValidation

REST

Formal methods are defined “HEAD”, “GET”, “PUT”, “POST”, “PATCH”, “DELETE”, “OPTIONS”.

All REST methods use Energy.Base.Http.Request and Energy.Base.Http.Response classes which represents web request and response.

GET

Perform GET and return response from URL.

public static Energy.Base.Http.Response Get(string url)
public static Energy.Base.Http.Response Get(string url, string acceptType)
public static Energy.Base.Http.Response Get(Energy.Base.Http.Request request)

POST

Perform POST and return response from HTTP request.

public static Energy.Base.Http.Response Post(Energy.Base.Http.Request request)

Perform POST and return response from URL.

public static Energy.Base.Http.Response Post(string url, object body, string contentType, string[] headers, string acceptType)

A little too many parameters, right?

public static Energy.Base.Http.Response Post(string url, object body, string contentType, string[] headers)
public static Energy.Base.Http.Response Post(string url, object body, string contentType)
public static Energy.Base.Http.Response Post(string url, object body)
public static Energy.Base.Http.Response Post(string url)

PUT

Perform PUT and return response from URL.

public static Energy.Base.Http.Response Put(string url, object body, string contentType, string[] headers)
public static Energy.Base.Http.Response Put(string url)
public static Energy.Base.Http.Response Put(string url, object body, string contentType)
public static Energy.Base.Http.Response Put(string url, object body)

PATCH

Perform PATCH and return response from URL.

public static Energy.Base.Http.Response Patch(Energy.Base.Http.Request request)
public static Energy.Base.Http.Response Patch(string url, object body, string contentType, string[] headers, string acceptType)
public static Energy.Base.Http.Response Patch(string url, object body, string contentType)
public static Energy.Base.Http.Response Patch(string url, object body)
public static Energy.Base.Http.Response Patch(string url)

DELETE

Perform DELETE and return response from URL.

public static Energy.Base.Http.Response Delete(Energy.Base.Http.Request request)
public static Energy.Base.Http.Response Delete(string url)

OPTIONS

Perform OPTIONS and return response from URL.

public static Energy.Base.Http.Response Options(Energy.Base.Http.Request request)
public static Energy.Base.Http.Response Options(string url)