http tests updated

This commit is contained in:
Vladimir Enchev
2014-05-15 11:14:00 +03:00
parent 5cb2af29b1
commit 7d20bbf533
2 changed files with 81 additions and 17 deletions

View File

@ -16,9 +16,7 @@ export function request(options: http.HttpRequestOptions): promises.Promise<http
var urlRequest = Foundation.NSMutableURLRequest.requestWithURL(
Foundation.NSURL.URLWithString(options.url));
if (options.method) {
urlRequest.setHTTPMethod(options.method);
}
urlRequest.setHTTPMethod(typeof options.method !== "undefined" ? options.method : "GET");
if (options.headers) {
for (var header in options.headers) {