URLSession

An extension to the URLSession class to allow simplified access to Predix hosted services

The URLSession extension handles the automatic population of the UAA authorization token, tracer IDs and other standard Predix access headers

Authentication and TraceId headers are only replaced if they are not present when the creation of the task occurs. This allows a developer to override the header values that are passed on request to a Predix service without having to provide all other headers manually

Authentication header information is not preserved between application sessions, once the application has been removed from the background by iOS you will need to re-authenticate with UAA to obtain a new active session. Pease consult the Apple documentation on the NSURLSessionDelegate for more information on how you can respond to an authentication challenge if required by the applications programming flow

  • Creates a new URLSession pre-configured with the URLSessionConfiguration.predix configuration

    The URLSessionConfiguration.predix configuration will auto populate required request header for accessing data via Predix hosted applications and services

    Declaration

    Swift

    public static var predix: URLSession

    Return Value

    A Predix configured URLSession