Skip to content

Before record response

Sergey edited this page Jul 28, 2018 · 2 revisions

YHVBeforeRecordResponseBlock

This block can be provided during VCR configuration (instead of fixed filter map) in addition to configured filters to make final adjustments to request, before it will be recorded.

Block signature shown below:

^NSArray * (NSURLRequest *request, NSHTTPURLResponse *response, NSData *data);

PARAMETERS

Name Type Description
request NSURLRequest Reference on request (after running beforeRecordRequest which should be stored onto cassette.
response NSHTTPURLResponse Reference on response object which provide information about received data.
data NSData Reference on actual server response binary data.

RETURNS

Array where first element is same (or adjusted) response instance and second element is same (or adjusted) data instance. It is possible to remove service response from stub by returning array only with response.

Clone this wiki locally