Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

316
Views
How I pass Parameters into Url with Get in Localhost with axios

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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

  • You need the scheme.
  • You need to encode special characters (like @!) before shoving them into the URL.
  • Template strings save on concatenation

Such:

const url = `http://localhost:1323/profile/email/${encodeURIComponent(email)}/password/${encodeURIComponent(password)}`
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!