If the url contains query parameters with a ? restangular adds a trailing slash, when it shouldn't
Restangular is adding an additional trailing slash in the middle of URL's that contain query parameters:
eg:
var get_params = { page:1,
page_size:25 };
var promise = Restangular.all("jobs/?triggered_by_job=263441").getList(get_params);
The resulting URL is:
http://localhost:8000/jobs/?triggered_by_job=263441/&page=1&page_size=25
When it needs to be:
http://localhost:8000/jobs/?triggered_by_job=263441&page=1&page_size=25
(Notice the additional trailing slash after the job=263441).
This url returns a 404 error as it is incorrect syntax.
The code has obviously noticed that there are query parameters in the URL as it hasn't added a second question mark, so is it possible to not put the slash in too please!
NB: I realise I could add triggered_by_job:263441 to get_params, and I will if I have to, but I'd rather not have to manipulate the URL if I can get away with it.
Hey,
Thanks for the report!
Do you have a request suffix set?
Hi,
Yes we are using '/' as a request suffix.
Then, you're going to need to send the requestParams as part of the get_params. That way, the request suffix will be added correctly, since where you are putting them isn't meant for that. Sorry about this.
Thanks!