как отправить post запрос через axios basic auth
как отправить post запрос через axios basic auth
и body в x-www-form-urlencoded const axios = require('axios') let session_url = '10.50.141.75:8845/auth' const requestBody = { login: "node js", password: "react js" } const config = { headers: { 'Content-type': 'application/x-www-form-urlencodeed' }, auth: { username: 'testq', password: 'test' } } axios.post(session_url,requestBody, config).then(function(response) { console.log('Authenticated') }).catch(function(error) { console.log(error) }) |
Часовой пояс GMT +3, время: 21:52. |