Click or drag to resize

IWebApi Methods

The IWebApi type exposes the following members.

Methods
  NameDescription
Public methodCode exampleAbandonAuthorization
Stop the flow of initial authorization
Public methodCode exampleCreateErrorResponse
Create http error response with status code and message
Examples
var webApi = ctx.Use<IWebApi>();
webApi.CreateErrorResponse(401, "You are not authorized");
Public methodCode exampleCreateResponseT
Create http response with data
Examples
var webApi = ctx.Use<IWebApi>();
var data = new { FirstName = "Thao", LastName = "Dinh" };        
webApi.CreateResponse(data);
Public methodCreateTextResponse
Create http response with text data
Public methodCode exampleGetHeaders
Get headers from the current request
Examples
var webApi = ctx.Use<IWebApi>();        
var headers = webApi.GetHeaders();
Public methodCode exampleGetQueryString
Get query string from the current request
Examples
var webApi = ctx.Use<IWebApi>();        
var queryString = webApi.GetQueryString();
Public methodCode exampleGetUri
Get URI from the current request
Examples
var webApi = ctx.Use<IWebApi>();        
var uri = webApi.GetUri();
Public methodGetUserIp
Get current user ip
Public methodCode exampleRedirect
Redirect the specific url
Examples
var webApi = ctx.Use<IWebApi>();        
webApi.Redirect("https://api-local.casewhere.com/external/v0.1/trigger/kk-nemlogin-logout-callback?nonce=b3c7c6ea-f38a-4b2a-aa6e-9c69fce65ec1");
Top
See Also