Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Code 0 #11

Open
mcandre opened this issue May 4, 2011 · 3 comments
Open

HTTP Code 0 #11

mcandre opened this issue May 4, 2011 · 3 comments

Comments

@mcandre
Copy link

mcandre commented May 4, 2011

When I test my php-simple-proxy installation by manually entering a remote URL in my web browser, it works fine.

But when I try to use JavaScript to get the same information, I just see:

Response: {"status":{"http_code":0},"contents":null}

var ajaxProxy = "php-simple-proxy/ba-simple-proxy.php?url=";

cardURL = ajaxProxy + cardURL;

info("Waiting for response on " + cardURL + "...");

$.ajax({
    type: "GET",
    timeout: 10000, // ms
    url: cardURL,
    cache: true,
    complete: function(response, status) {
        alert("Response: " + response.responseText);
    }
});
@mcandre
Copy link
Author

mcandre commented May 4, 2011

Modifying this to use $.get yields the same result, and $.get with native mode enabled returns empty response text.

@mathphreak
Copy link

Same issue here. I'm getting {"status":{"http_code":0},"contents":null} from both manually entering the URL and going through JavaScript (easyXDM specifically).

@Luciaisacomputer
Copy link

Luciaisacomputer commented May 2, 2016

Make sure you are encoding your URL, I ran into this issue recently, and after bashing my head in, realized I need to use encodeURIComponent on my URL string. Once I did that, everything worked. The example on the site uses serialize() on the whole form which also encodes HTML entities. Hopefully this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants