Class WebApiException
Represents a non successful response while executing a WebApi call.
Inheritance
System.Object
WebApiException
Namespace: DotNetNuke.Web.Api
Assembly: DotNetNuke.Web.dll
Syntax
public class WebApiException : Exception
Constructors
| Improve this Doc View SourceWebApiException(Exception, HttpResponseMessage, String)
Initializes a new instance of the WebApiException class.
Declaration
public WebApiException(Exception innerException, HttpResponseMessage result, string body)
Parameters
Type | Name | Description |
---|---|---|
Exception | innerException | The original exception. |
HttpResponseMessage | result | The result of the request. |
System.String | body | The body from the GET response. |
WebApiException(Exception, HttpResponseMessage)
Initializes a new instance of the WebApiException class, with the specified inner exception and response. message that caused the exception.
Declaration
public WebApiException(Exception innerException, HttpResponseMessage result)
Parameters
Type | Name | Description |
---|---|---|
Exception | innerException | The original exception. |
HttpResponseMessage | result | The result of the request. |
Properties
| Improve this Doc View SourceBody
Gets body from the Get Response. Available when exception is thrown as well.
Declaration
public string Body { get; }
Property Value
Type | Description |
---|---|
System.String |
Result
Gets the result of the request. Can be used to retrieve additional info like HTTP status code.
Declaration
public HttpResponseMessage Result { get; }
Property Value
Type | Description |
---|---|
HttpResponseMessage |
Methods
| Improve this Doc View SourceBodyAsJson()
Represents a non successful response while executing a WebApi call.
Declaration
public dynamic BodyAsJson()
Returns
Type | Description |
---|---|
System.Object |