<TRCPreProcessor> Protocol Reference

TRCPreProcessor is per-request pre-processor. More...

Inheritance diagram for <TRCPreProcessor>:

Instance Methods

(id) - preProcessResponseObject:forRequest:preProcessError:
 This method is invoked at the beginning (after checking for errors, but before validation and post-processing) of response processing. More...
 

Detailed Description

TRCPreProcessor is per-request pre-processor.

This pre-processor useful when you want centralized place to modify all response objects. You can check for TRCRequest.customProperties here for targeting (or use another criteria for that)

Note
If more than one TRCPreProcessor registered, then result chaining, i.e. output of preProcessor1 used as input for preProcessor2: (object —> preProcessor1 –> preProcessor2 –> ... –> result) This rule correct for both method in that protocol

Method Documentation

◆ preProcessResponseObject:forRequest:preProcessError:()

- (id) preProcessResponseObject: (id)  responseObject
forRequest: (id< TRCRequest >)  request
preProcessError: (NSError **)  error 
optional

This method is invoked at the beginning (after checking for errors, but before validation and post-processing) of response processing.

The result of this method would be used instead of input responseObject.