From 86e081528fd2469c90bb2eac550f8932541e9c93 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Thu, 22 May 2014 14:17:40 +0300 Subject: [PATCH] comments added --- http/http.d.ts | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/http/http.d.ts b/http/http.d.ts index e6b07ca32..025a064b9 100644 --- a/http/http.d.ts +++ b/http/http.d.ts @@ -45,24 +45,68 @@ function request(options: HttpRequestOptions): promises.Promise; interface HttpRequestOptions { + /** + * Gets or sets the request url. + */ url: string; + + /** + * Gets or sets the request method. + */ method: string; + + /** + * Gets or sets the request headers in JSON format. + */ headers?: any; + + /** + * Gets or sets the request body. + */ content?: any; + + /** + * Gets or sets the request timeout. + */ timeout?: number; } interface HttpResponse { + /** + * Gets the response status code. + */ statusCode: number; + + /** + * Gets the response headers. + */ headers: any; + + /** + * Gets the response content. + */ content?: HttpContent; } interface HttpContent { + /** + * Gets the response body as raw data. + */ raw: any; + + /** + * Gets the response body as string. + */ toString: () => string; - // TODO: Isn't parseJSON better naming? toJSON sounds to me like we will return a string object + + /** + * Gets the response body as JSON object. + */ toJSON: () => any; + + /** + * Gets the response body as ImageSource. + */ toImage: () => image.ImageSource; } } \ No newline at end of file