B
B
bugagashnik2018-05-23 12:56:52
JavaScript
bugagashnik, 2018-05-23 12:56:52

How to make such a request using axios?

The bottom line is that I need to send auth(type bearer+token), and body

promise: request.post(
      `${API_URL}auth/confirm-phone/send`,
        {},
        {
        data:{
          phone:{phone}
        },
        auth:{
          type:'bearer',
          bearer:{
            key:'token',
            value:{token},
            type:'string'
          }
        }
        
      }
    )

This is how I formed the body of the request. Tell me what's wrong? I suspect that the order is wrong or not correctly designed. I read the documentation, and reached what you see above)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2018-05-23
@ilyapashkov02

in general, for good, the token in the headers is sent

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question