react-native-fetch-polyfill icon indicating copy to clipboard operation
react-native-fetch-polyfill copied to clipboard

can't add header

Open TaraSinghDanu opened this issue 7 years ago • 1 comments
trafficstars

return fetch(CommonStyle.BaseUrl + 'history/' + userID, { headers: { 'quidtoken': userID, } },{timeout: 10})

TaraSinghDanu avatar Aug 04 '18 15:08 TaraSinghDanu

Hi @TaraSinghDanu, you should be able to add headers just like you would normally with fetch.

Although, make sure timeout is provided alongside the headers as the 2nd argument provided to fetch. Example:

fetch(CommonStyle.BaseUrl + 'history/' + userId, {
  headers: {'quidtoken': userID},
  timeout: 10
})

atticoos avatar Aug 06 '18 14:08 atticoos