GTRKCommonRequestHeaders
enum GTRKCommonRequestHeaders : String
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
-
Content-Type
Declaration
Swift
case contentType = "Content-Type"
-
Authorization
Declaration
Swift
case authorizationBearer = "Authorization"
-
Accept
Declaration
Swift
case accept = "Accept"
-
Accept-Language
Declaration
Swift
case acceptLanguage = "Accept-Language"
-
Accept-Charset
Declaration
Swift
case acceptCharset = "Accept-Charset"
-
Keep-Alive
Declaration
Swift
case keepAlive = "Keep-Alive"
-
Cache-Control
Declaration
Swift
case cacheControl = "Cache-Control"