swift - Why is not recommended to modify session configuration for authorization headers in Alamofire? -
from: https://github.com/alamofire/alamofire
modifying session configuration
... example code ...
this not recommended authorization or content-type headers. instead, use urlrequestconvertible , parameterencoding, respectively.
ok, not use it, why not recommended handling authorization headers?
there couple of reasons why recommend this.
the session configuration headers should set not going change throughout lifecycle of session such
accept-encoding
,accept-language
,user-agent
, etc. if need set header possibly change between requests, should add headernsurlrequest
takes precedence on session configuration headers.modifying session's configuration headers after configuration has been created not behavior consistently between ios 7 , ios 8. see thread more info.
hopefully helps clear things bit.
Comments
Post a Comment