• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

387
Views
Remove trailing slash at the end of axios url request

I am trying to do a request with axios, but it keeps adding a trailing slash right before my query parameters and so it stops working, I can't figure out for the life of me what the hell is its problem and I cant find any options in the config to remove it.

This is the url that I want to send request to

http://localhost:3000/api/competition/player-joined?userId=${accounts[i].dbId}&competitionId=a80flwvap1lbhef3d704

Axios sends request to this instead:

http://localhost:3000/api/competition/player-joined/?userId=${accounts[i].dbId}&competitionId=a80flwvap1lbhef3d704

There is a / right before the ? being added by axios itself when sending the request.

This is a standalone js file that I am running with node.

The suggested questions that solve this issue DO NOT SOLVE THE ISSUE.

Also, Axios is automatically doing that, I am not giving it a string with a slash, so its not a matter of simple "replace string".

about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error