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

613
Views
How to convert cURL request to axios

I want to use the below cURL command with the axios. How I can do that?

curl -XPOST -d 'url=https%3A%2F%2Fgoogle.com%2F' 'https://goolnk.com/api/v1/shorten'

I have tried in this way but seems to be incorrect:

axios.post("https://goolnk.com/api/v1/shorten", {
   url: "https%3A%2F%2Fgoogle.com%2F"
}).then(function (response) {
      console.log(response)
   })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You almost made it, but url key should just be a link string, without any special symbols.

axios
  .post('https://goolnk.com/api/v1/shorten', { url: 'https://google.com' })
  .then((res) => {
    console.log(res.data);
  });

Please, don't post code as images in the future, instead insert it as code block in the text.

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!