Skip to main content

Requests and Responses

While the WebTrendsSDK provides standard operations supported by the WebTrends API, it is possible to craft your own requests if the WebTrendsSDK does not currently support an operation you need.

Requests

The WebTrendsSDK provides two request types, WebTrendsRequest and WebTrendsRequest<TData>. These are defined here: https://github.com/IngeniumSE/WebTrendsSDK/blob/main/libs/WebTrendsSDK/WebTrendsRequest.cs

The latter WebTrendsRequest<TData> inherits from WebTrendsRequest but is tailored towards sending payload data to the WebTrends API.

Developer-friendly Debugging

The primary consumer of this SDK are developers, so the WebTrendsSDK has been designed to give as much information as possible to developers to aid in understanding any integration issues.

Request and Response Content

The WebTrendsResponse and WebTrendsResponse<TData> type contains useful properties for debugging requests and responses.

PropertyTypeNotes
StatusCodeHttpStatusCodeThe HTTP status code of the response
RequestMethodHttpMethodThe HTTP method used
RequestUriUriThe requested URI resource
RequestContentstring?The captured HTTP request content
ResponseContentstring?The captured HTTP response content

By default, the RequestContent and ResponseContent properties will not be populated, these have to be enabled in your app configuration:

{
"WebTrends": {
"CaptureRequestContent": true,
"CaptureResponseContent": true
}
}

Alternatively, you can explicitly enable them through WebTrendsSettings:

var settings = new WebTrendsSettings
{
CaptureRequestContent = true,
CaptureResponseContent = true
};