Show / Hide Table of Contents

Class ResponseCallbacks

Default implementation of the IResponseCallbacks interface

Inheritance
Object
ResponseCallbacks
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: FakeHttp
Assembly: FakeHttp.dll
Syntax
public class ResponseCallbacks : IResponseCallbacks

Properties

| Improve this Doc View Source

FilterCommonSensitiveValues

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

Declaration
public bool FilterCommonSensitiveValues { get; set; }
Property Value
Type Description
Boolean
Implements
IResponseCallbacks.FilterCommonSensitiveValues
| 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
public virtual IEnumerable<string> FilteredHeaderNames { get; }
Property Value
Type Description
IEnumerable<String>
Implements
IResponseCallbacks.FilteredHeaderNames
| Improve this Doc View Source

FilteredParameterNames

A list of query parameter names that will not be serialized

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

SetHeaderDate

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

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

True

Implements
IResponseCallbacks.SetHeaderDate

Methods

| Improve this Doc View Source

Deserialized(ResponseInfo, Stream)

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

Declaration
public virtual 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

Implements
IResponseCallbacks.Deserialized(ResponseInfo, Stream)
| Improve this Doc View Source

FilterParameter(String, String)

Determines if a given query parameter should be excluded from serialization

Declaration
public virtual 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 if the parameter should be filtered from serialization

Implements
IResponseCallbacks.FilterParameter(String, String)
| Improve this Doc View Source

Serializing(HttpResponseMessage)

Called after content is retrieved from the actual service and before it is 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
public virtual Task<Stream> Serializing(HttpResponseMessage response)
Parameters
Type Name Description
HttpResponseMessage response

The response

Returns
Type Description
Task<Stream>

The original content stream or a modified content stream

Implements
IResponseCallbacks.Serializing(HttpResponseMessage)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX