aronbalog / Vox

Swift JSON:API client framework
http://jsonapi.org
MIT License
46 stars 19 forks source link

usefulness of userInfo #9

Open Thiryn opened 6 years ago

Thiryn commented 6 years ago

I am not sure the userInfo is the best way to handle user-specific data. In the documentation it says that userInfo is used for adding headers at run-time. I think headers should be an attribute of Request and methods such as Request::addHeader and Request::removeHeader should be used to manipulate headers to be able to do something like

personDataSource
    .fetch(1)
    .addHeader("token", "YsbV6gL35d")
    .result(/* [..] */)

At another extent, the Alamofire Client does not uses the userData for headers here