Class ResponseCallbacks
Default implementation of the IResponseCallbacks interface
Inherited Members
Namespace: FakeHttp
Assembly: FakeHttp.dll
Syntax
public class ResponseCallbacks : IResponseCallbacks
Properties
| Improve this Doc View SourceFilterCommonSensitiveValues
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
| Improve this Doc View SourceFilteredHeaderNames
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
| Improve this Doc View SourceFilteredParameterNames
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
| Improve this Doc View SourceSetHeaderDate
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
Methods
| Improve this Doc View SourceDeserialized(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
| Improve this Doc View SourceFilterParameter(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
| Improve this Doc View SourceSerializing(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 |