I want to consume my api. it is in go lang. i use axios in front (react) for consume it
my route:
localhost:1323/profile/email/:email/password/:password
i don't know how i can pass the email and password in axios request with get.
my code:
import axios from 'axios'
export async function validLogin(email, password) {
const valid = await axios.get('localhost:1323/profile/email/'+ email + '/password/'+ password).then((response) => {
return response;
});
return valid
}
I tried to use http://localhost instead localhost pure, but don't work too.
@
!) before shoving them into the URL.Such:
const url = `http://localhost:1323/profile/email/${encodeURIComponent(email)}/password/${encodeURIComponent(password)}`
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.