JcConnectionRequest

public class JcConnectionRequest<T> where T : JcSimpleConnection

Convenience class to simplify API calls via wrapped instances of UrlRequest and UrlSession You will need instantiate a valid JcConnection object via the JcConnectionFactory class to instantiate an object of this class.

Notes:

This class should not be used directly, use it as a inherited class and leverage the various _get(resourcePath:completionHandler:), _delete(resourcePath:completionHandler:) _execute(method:resourcePath:contentType:request:completionHandler:) methods from your class.

Objects derived from this class are not thread safe and should be reused. Create an instance for each request as required

  • Defines the HTTP method to be used

    See more

    Declaration

    Swift

    public enum Method : String
  • Invoke this as your super init to propagate the connection parameter

    Declaration

    Swift

    public init(_ connection: T)
  • Default type for acceptable respnose format, can be overriden if required

    Declaration

    Swift

    open func acceptTypeForResponse<RequestContent>(_ data: RequestContent) -> String?
  • Undocumented

    See more

    Declaration

    Swift

    public struct APIError : Error