Querystrings in Manialinks (Bad Request)

Trackmania Forever public API and its open source PHP SDK.

Moderator: NADEO

Post Reply
User avatar
Posts: 124
Joined: 16 Jun 2010, 22:17

Querystrings in Manialinks (Bad Request)

Post by destroflyer » 10 May 2011, 19:09

Hi all,
I don't know if that's a bug or not: If you use a querystring like ...
... the API throws an error 'Bad Request'.
Fatal error: Uncaught exception 'TrackMania_Exception' with message 'Bad request' in [...]/trackmania-ws.php:519
Stack trace:
#0 [...]/trackmania-ws.php(355): TrackMania_WebServices->execute('GET', '/tmf/manialinks...', Array)
#1 [...]/trackmania-ws.php(44): TrackMania_WebServices->executeGET('/tmf/manialinks...', Array)
#2 [...]
#3 [...]
#4 [...]
#5 {main}
thrown in [...]/trackmania-ws.php on line 519
Of course, the querystring is not part of a maniacode and you could use it later in your code, but it may be helpful for beginners, if the API would just remove every querystring from the requestes code and just return the data for the simple maniacode. (Instead of throwing an error)

But I can understand other opinions, too ^__^ (Because with a querystring, it's not a "real" maniacode ;))

destro :)

User avatar
Posts: 1188
Joined: 14 Jun 2010, 17:20

Re: Querystrings in Manialinks (Bad Request)

Post by gouxim » 10 May 2011, 22:35


I tested the manialink "test?test=test" which should return 404 because it does not exists. So the URL is

http://ws.trackmania.com/tmf/manialinks ... st%3Dtest/ (note the URL encoding)

And it returns 400 indeed, although it should return 404. There's a bug on the server, I'll look into it tomorow.

However, I don't think the API should be automatically stripping the query string in order to keep things simple. It'd be very easy to strip it on your end before calling the API.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

Post Reply

Return to “Trackmania Forever Web Services”

Who is online

Users browsing this forum: No registered users and 2 guests