FWURLRequestSerialization

@protocol FWURLRequestSerialization <NSObject, NSSecureCoding, NSCopying>

The FWURLRequestSerialization protocol is adopted by an object that encodes parameters for a specified HTTP requests. Request serializers may encode parameters as query strings, HTTP bodies, setting the appropriate HTTP header fields as necessary.

For example, a JSON request serializer may set the HTTP body of the request to a JSON representation, and set the Content-Type HTTP header field value to application/json.

  • Returns a request with the specified parameters encoded into a copy of the original request.

    Declaration

    Objective-C

    - (nullable NSURLRequest *)
        requestBySerializingRequest:(nonnull NSURLRequest *)request
                     withParameters:(nullable id)parameters
                              error:(NSError *__autoreleasing _Nullable *_Nullable)
                                        error;

    Parameters

    request

    The original request.

    parameters

    The parameters to be encoded.

    error

    The error that occurred while attempting to encode the request parameters.

    Return Value

    A serialized request.