Truncated response to HTTP.post()


#1

I have a meteor method that makes a call to a remote api:

 do_the_thing:function() {
        this.unblock();
        console.log("doing the thing")
        
    HTTP.post( "http://super.rad.api",{headers: { 'Content-Type': 'application/x-www-form-urlencoded' }}, function(err,result) {
        if(err) { console.log(err) } 
        console.log(result)
        return
    });
    }

I can send params that allow me to fetch between 1 and MAX_RECORDS (50 in this case). When I request more than a few records at a time the response is truncated, usually mid-record. Am I missing something obvious here? I’ve tested the api call with a firefox plugin and all is groovy


#2

Note, when I make the API call from the client I do not have truncated replies…


#3

this.unblock() on the server allows a subsequent method to begin running before this method has completed. On the client this.unblock() does nothing (no fibers on the client). I suspect that removing this.unblock() will fix the issue.