I have a small problem. I'm sending an AJAX call to retrieve JSON using a php proxy hosted on my website. It's working great, but whenever there's an argument with a space, it gets encoded as %20 and I get back:
{"status":{"http_code":400},"contents":"<html><body><h1>400 Bad request<\/h1>
Your browser sent an invalid request.
<\/body><\/html>
"}
How else can I encode the space to make this work? Here's an example of the bad request URL. The space appears in the city name "Santa Monica":
http://www.mysite.com/ba-simple-proxy.php?url=https%3A%2F%2Fwww.eventbrite.com%2Fjson%2Fevent_search%3Fcity%3DSanta%20Monica%26region%3DCA%26country%3DUS%26within%3D15%26within_unit%3DM%26start%3D2013-12-10%26max%3D50
EDIT: AJAX request here:
$.ajax({
type: 'GET',
url:'http://www.mysite.com/ba-simple-proxy.php?url=https%3A%2F%2Fwww.eventbrite.com%2Fjson%2Fevent_search%3Fcity%3DSanta%20Monica%26region%3DCA%26country%3DUS%26within%3D15%26within_unit%3DM%26start%3D2013-12-10%26max%3D50',
dataType: "json",
success: jsonFunction,
error: jsonFunction
});