Show / Hide Table of Contents

Interface IResponseCallbacks

Callback interface to allow tests to supply runtime logic for responses

Namespace: FakeHttp
Assembly: FakeHttp.dll
Syntax
public interface IResponseCallbacks

Properties

| Improve this Doc View Source

FilterCommonSensitiveValues

Flag indicating whether to automatically filter commonly used header and query parameter names such as X-API-KEY, api-key, key, etc from being serialized

Declaration
bool FilterCommonSensitiveValues { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

FilteredHeaderNames

A list of header names that will not be serialized. For example x-api-key may not be something to store

Declaration
IEnumerable<string> FilteredHeaderNames { get; }
Property Value
Type Description
IEnumerable<String>
| Improve this Doc View Source

FilteredParameterNames

A list of query parameter names that will not be serialized

Declaration
IEnumerable<string> FilteredParameterNames { get; }
Property Value
Type Description
IEnumerable<String>
| Improve this Doc View Source

SetHeaderDate

Flag indicating whether to automatically set the Date header to the current date/time on deserialization

Declaration
bool SetHeaderDate { get; set; }
Property Value
Type Description
Boolean

Methods

| Improve this Doc View Source

Deserialized(ResponseInfo, Stream)

Called just before the response is returned. Update deserialized values as necessary Primarily for cases where time based header values (like content expiration) need up to date values

Declaration
Stream Deserialized(ResponseInfo info, Stream content)
Parameters
Type Name Description
ResponseInfo info

Deserialized response data. Header collections can be modified. Might be null if content file but no response file is present

Stream content

The deserialized content stream. Might be null if response has no content

Returns
Type Description
Stream

The original content or a modified content stream to attach to the HttpResponseMessage

| Improve this Doc View Source

FilterParameter(String, String)

Determines if a given query parameter should be excluded from serialization

Declaration
bool FilterParameter(string name, string value)
Parameters
Type Name Description
String name

The name of the Uri query parameter

String value

The value of the uri query parameter

Returns
Type Description
Boolean

True to filter the parameter. False to include in serialization and hashing

| Improve this Doc View Source

Serializing(HttpResponseMessage)

Called after content is retrieved from the actual service during capturing and before it is saved to disk. Primarily allows for response content to mask sensitive data (ex SSN or other PII) before it is saved to storage

Declaration
Task<Stream> Serializing(HttpResponseMessage response)
Parameters
Type Name Description
HttpResponseMessage response

The service response

Returns
Type Description
Task<Stream>

The original content or a modified content stream to save to storage

  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX