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

Issue 21 - http request returns blocked with POST and PUT - haxe #21

Closed
issuesbot opened this issue May 28, 2013 · 1 comment
Closed

Comments

@issuesbot
Copy link

[Google Issue #21 : https://code.google.com/p/haxe/issues/detail?id=21]
by peregrin...@gmail.com, at 02/12/2009, 18:58:18
What steps will reproduce the problem?

  1. Create a haxe.Http object
  2. Set Headers and Post Data
  3. Initiate Request with POST or PUT

What is the expected output? What do you see instead?
Expected: successful http POST and PUT.
Result: Thrown exception "Blocked"

What version of the product are you using? On what operating system?
HaXe 2.04 on Mac OsX

Please provide any additional information below.

In addition to the code below, I've tried setting a longer connection timeout, and closing the
request. Neither of these worked, nor did including the lines I've commented out.

var http:Http = new haxe.Http(url);
var dataLength:Int = if (data == null) 0; else data.length;

        try {
    var hasPost:Bool = if(data == null) false; 
    else {
        http.setPostData(data);
        true;
    }
    http.onError = failure;
    //http.setHeader("User-Agent", _curl.userAgent);
    //http.setHeader("Content-type", "text");
    //http.setHeader("Host", url);
    http.setHeader("Content-length", Std.string(dataLength));
    http.onData = function(output) {
        trace(output);
        success(output);
    }
    http.request(hasPost);
}
        catch (e:Dynamic) {
    failure(Std.string(e));
}
@issuesbot
Copy link
Author

[comment from ncanna...@gmail.com, published at 03/01/2010, 17:21:08]
Blocked is raised when a timeout occur while reading the answer. In order to check if
that comes from the server or from the client, please give us a fully reproducible
example with a commonly used host which accept POST data (google or something like that).

frabbit pushed a commit to frabbit/haxe-1 that referenced this issue Apr 6, 2014
elliott5 added a commit to elliott5/haxe that referenced this issue May 28, 2014
nadako pushed a commit that referenced this issue Apr 2, 2019
nadako pushed a commit to nadako/haxe that referenced this issue Apr 26, 2019
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

1 participant