factmaven / xml-to-json

Simple API that converts dynamic XML feeds to JSON through a URL or pasting the raw XML data. Made 100% in PHP.
https://api.factmaven.com/xml-to-json
54 stars 24 forks source link

Bug with spaces? #12

Open swamiofsuccess opened 2 years ago

swamiofsuccess commented 2 years ago

The API is working fine with URLs until one of them has a space in it. (I replaced the space with %20 before sending it.) But, I get this error:

{"error":{"timestamp":"2022-06-18 07:41:55 EST","status":400,"title":"Failed Loading XML","detail":["Start tag expected, '<' not found"],"url":"\/xml-to-json\/?xml=https:\/\/boardgamegeek.com\/xmlapi\/search?search=ticket%20to%20ride"},"meta":{"version":"2.0.2","copyright":"Copyright 2011-2022 Fact Maven","link":"https:\/\/factmaven.com\/","authors":["Ethan O'Sullivan","Edward Bebbington"]}}

Here's the URL I used: https://api.factmaven.com/xml-to-json/?xml=https://boardgamegeek.com/xmlapi/search?search=ticket%20to%20ride

More than possible that this is my issue, but read through the other issues and comments. Might be the same issue as this?

I tried it with some other URLs and seems to fail when there's a %20. This works: https://api.factmaven.com/xml-to-json/?xml=https://boardgamegeek.com/xmlapi/search?search=Crossbows This doesn't: https://api.factmaven.com/xml-to-json/?xml=https://boardgamegeek.com/xmlapi/search?search=Crossbows%20and

Thanks for any help you can offer!