0
good night
I’m having trouble converting this code
<form action="https://www.personal.com.py/ApiComerciosMaven/webresources/autenticacion/" method="post">
<p>
AUTENTICAR USUARIO
</P>
<p style="font-size:medium;font-weight:bold;">USUARIO
<input type="text" name="usuario" value="test">
</p>
<p style="font-size:medium;font-weight:bold;">CLAVE
<input type="text" name="clave" value="test">
</p>
<p>
<input type="submit" value="AUTENTICAR"/>
</p>
</P>
</form>
for Xios, I tried this
axios.post('https://www.personal.com.py/ApiComerciosMaven/webresources/autenticacion/', {usuario: 'AA', clave: 'AA'}).then(req => {
console.log('Req done: ', req)
}).catch(err => {
console.error('Error: ', err)
})
and so
const data = new FormData();
data.append('usuario', 'AA');
data.append('clave', 'AA');
axios.post('https://www.personal.com.py/ApiComerciosMaven/webresources/autenticacion/', data).then(req => {
console.log('Req done: ', req)
}).catch(err => {
console.error('Error: ', err)
})
however the request with html returns me the expected date but with Axios no, how could I convert this html into an Axios request?
thanks in advance
Try to send via get with params:
axios.get('https://www.personal.com.py/ApiComerciosMaven/webresources/autenticacion/', { params: {usuario: 'AA', clave: 'AA'}}).then(
– Sam