Enumerations

The following enumerations are available globally.

  • The provided HTTP methods by GTRestKit.

    Here’s the list of the provided HTTP methods.

    • GET
    • POST
    • PUT
    • PATCH
    • DELETE

    If the method you want to use does not exist, then feel free to add it to this enum in accordance to the existing cases.

    See more

    Declaration

    Swift

    enum GTRKHTTPMethod
  • A list of common request headers provided for conveniency.

    If you want to use a header that is not present here, then feel free to add it so you can conveniently access it in the future, or just provide it directly to the requestHeaders property or to the add(requestHeader:withValue:) method.

    Example:

    let restKit = GTRestKit()
    restKit.add(requestHeader: GTRKCommonRequestHeaders.contentType.rawValue,
                withValue: GTRKCommonRequestHeaderValues.contentTypeApplicationJSON.rawValue)
    
    // or
    restKit.requestHeaders[GTRKCommonRequestHeaders.contentType.rawValue] = GTRKCommonRequestHeaderValues.contentTypeApplicationJSON.rawValue
    

    Available header keys:

    • contentType: Content-Type
    • authorizationBearer: Authorization
    • accept: Accept
    • acceptLanguage: Accept-Language
    • acceptCharset: Accept-Charset
    • keepAlive: Keep-Alive
    • cacheControl: Cache-Control
    See more

    Declaration

    Swift

    enum GTRKCommonRequestHeaders : String
  • A list of common request header values provided for conveniency.

    If you want to use a header value that is not present here, then feel free to add it so you can conveniently access it in the future, or just provide it directly to the requestHeaders property or to the add(requestHeader:withValue:) method.

    Example:

    let restKit = GTRestKit()
    restKit.add(requestHeader: GTRKCommonRequestHeaders.contentType.rawValue,
                withValue: GTRKCommonRequestHeaderValues.contentTypeApplicationJSON.rawValue)
    
    // or
    restKit.requestHeaders[GTRKCommonRequestHeaders.contentType.rawValue] = GTRKCommonRequestHeaderValues.contentTypeApplicationJSON.rawValue
    

    Available values:

    • contentTypeTextPlain: text/plain; charset=utf-8
    • contentTypeTextHTML: text/html charset=utf-8
    • contentTypeApplicationJSON: application/json
    • cacheControlNoCache: no-cache
    See more

    Declaration

    Swift

    enum GTRKCommonRequestHeaderValues : String
  • Some common mime types the can be used for conveniency.

    • textPlain: text/plain
    • textHTML: text/html
    • textCSS: text/css
    • textCSV: text/csv
    • imageJPEG: image/jpeg
    • imagePNG: image/png
    • imageGIF: image/gif
    • audioWAV: audio/wav
    • audioOGG: audio/ogg
    • videoOGG: video/ogg
    • videoMPEG: video/mpeg
    • applicationOGG: application/ogg
    • applicationPDF: application/pdf
    • applicationRTF: application/rtf
    • applicationZIP: applization/zip
    • applicationJSON: application/json
    • applicationOctetStream: application/octet-stream
    • applicationJavascript: application/javascript
    • applicationXML: application/xml
    See more

    Declaration

    Swift

    enum GTRKMimeTypes : String