title: Redux-Saga pass headers to axios.post call
body: <p>I am having some difficulties with <code>redux-saga</code>. I have the following saga:</p>
  
  <p><code>createPostSaga</code>:</p>
  
  <pre><code>function* createPostSaga(action) {
    const token = yield select(selectToken);
    const headerParams = {
      Authorization: `JWT ${token}`
    };
    console.log(token, headerParams);
    try {
      yield call(axios.post, "/posts/", action.payload, headerParams);
      yield call(getPosts());
    } catch (error) {
      console.log(error);
    }
  }
  </code></pre>
  
  <p>As you can see I am selecting my token, and putting into an object with key <code>Authorization</code> and value <code>JWT ${token}</code>, my API is still responding with <code>401 unauthorized</code>, but it must be an issue with this call because I can replicate this call in Postman and it goes through fine:</p>
  
  <p><a href="https://i.stack.imgur.com/lrT4x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lrT4x.png" alt="Postman Request"></a></p>
  
  <p>Does anyone see what I did wrong? </p>