Merge pull request #148 from GameScripting/master
Fixed bug with HTTP post in the http.request module
This commit is contained in:
commit
8941d1b627
1 changed files with 9 additions and 8 deletions
|
@ -70,15 +70,16 @@ exports.request = function( request, callback ) {
|
||||||
url = request;
|
url = request;
|
||||||
requestMethod = 'GET';
|
requestMethod = 'GET';
|
||||||
}else{
|
}else{
|
||||||
|
url = request.url;
|
||||||
paramsAsString = paramsToString( request.params );
|
paramsAsString = paramsToString( request.params );
|
||||||
if ( request.method ) {
|
if ( request.method ) {
|
||||||
requestMethod = request.method;
|
requestMethod = request.method;
|
||||||
} else {
|
} else {
|
||||||
requestMethod = 'GET';
|
requestMethod = 'GET';
|
||||||
}
|
}
|
||||||
if ( requestMethod == 'GET' && request.params ) {
|
if ( requestMethod == 'GET' && request.params ) {
|
||||||
// append each parameter to the URL
|
// append each parameter to the URL
|
||||||
url = request.url + '?' + paramsAsString;
|
url = request.url + '?' + paramsAsString;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
conn = new java.net.URL( url ).openConnection();
|
conn = new java.net.URL( url ).openConnection();
|
||||||
|
|
Reference in a new issue