MoltinRequest

public class MoltinRequest

Base class which various endpoints extend from. This class is responsible for orchestrating a request, by constructing queries, authenticating calls, and parsing data.

  • Add some includes to the query

    Author

    Craig Tweedy

    Declaration

    Swift

    public func include(_ includes: [MoltinInclude]) -> Self

    Parameters

    includes

    An array of MoltinInclude to append to the request

    Return Value

    A instance of MoltinRequest which encapsulates the request.

  • Add a limit parameter to the query

    Author

    Craig Tweedy

    Declaration

    Swift

    public func limit(_ limit: Int) -> Self

    Parameters

    limit

    The amount of items to return

    Return Value

    A instance of MoltinRequest which encapsulates the request.

  • Add a sort parameter to the query

    Author

    Craig Tweedy

    Declaration

    Swift

    public func sort(_ sort: String) -> Self

    Parameters

    sort

    The sort order to use

    Return Value

    A instance of MoltinRequest which encapsulates the request.

  • Add an offset parameter to the query

    Author

    Craig Tweedy

    Declaration

    Swift

    public func offset(_ offset: Int) -> Self

    Parameters

    offset

    The amount of items to offset by

    Return Value

    A instance of MoltinRequest which encapsulates the request.

  • Add an filter parameter to the query

    Author

    Craig Tweedy

    Declaration

    Swift

    public func filter(operator op: MoltinFilterOperator, key: String, value: String) -> Self

    Parameters

    operator
    key

    The key for the filter

    value

    The value for the filter

    Return Value

    A instance of MoltinRequest which encapsulates the request.

  • Add a header to the request

    Author

    Craig Tweedy

    Declaration

    Swift

    public func addHeader(_ key: String, withValue value: String) -> Self

    Parameters

    key

    The header key

    withValue

    The header value

    Return Value

    An instance of MoltinRequest which encapsulates the request.