@libj/http
Advanced tools
Comparing version 0.3.4 to 0.4.0
@@ -1,2 +0,2 @@ | ||
import { HttpClientConfig, HttpRequestOptions, HttpResponse, HttpSubmitArgs } from './types'; | ||
import { GetRequestOptions, HttpClientConfig, HttpRequestOptions, HttpResponse, HttpSubmitArgs } from './types'; | ||
import { LooseObject } from '../common/types'; | ||
@@ -6,3 +6,3 @@ export declare class HttpClient { | ||
/*** Public ***/ | ||
get<D = LooseObject>(url: string, options?: HttpRequestOptions): Promise<HttpResponse<D>>; | ||
get<D = LooseObject>(url: string, options?: GetRequestOptions): Promise<HttpResponse<D>>; | ||
post<D = LooseObject>(...args: HttpSubmitArgs): Promise<HttpResponse<D>>; | ||
@@ -9,0 +9,0 @@ request<D = LooseObject>(url: string, options?: HttpRequestOptions): Promise<HttpResponse<D>>; |
@@ -20,2 +20,3 @@ "use strict"; | ||
var httpLoggerInterceptor_1 = require("../interceptors/httpLoggerInterceptor"); | ||
var src_2 = require("@libj/make-uri"); | ||
var HttpClient = /** @class */ (function () { | ||
@@ -34,3 +35,4 @@ function HttpClient(config) { | ||
if (options === void 0) { options = {}; } | ||
return this.request(url, __assign(__assign({}, options), { method: src_1.HttpMethod.GET })); | ||
var finalUrl = options.query ? src_2.makeUri(url, { query: options.query }) : url; | ||
return this.request(finalUrl, __assign(__assign({}, options), { method: src_1.HttpMethod.GET })); | ||
}; | ||
@@ -37,0 +39,0 @@ HttpClient.prototype.post = function () { |
@@ -7,2 +7,5 @@ import { AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
} | ||
export interface GetRequestOptions extends HttpRequestOptions { | ||
query?: LooseObject; | ||
} | ||
export interface HttpClientConfig extends HttpRequestOptions { | ||
@@ -9,0 +12,0 @@ logger?: LoggerInterface; |
{ | ||
"dependencies": { | ||
"@libj/http-meta": "0.1.6", | ||
"@libj/logger": "0.0.6", | ||
"@libj/http-meta": "0.1.7", | ||
"@libj/logger": "0.0.7", | ||
"axios": "^0.21.1", | ||
"form-data": "^4.0.0", | ||
"fs-extra": "^8.1.0" | ||
"fs-extra": "^8.1.0", | ||
"@libj/make-uri": "1.1.15" | ||
}, | ||
"name": "@libj/http", | ||
"version": "0.3.4", | ||
"version": "0.4.0", | ||
"description": "Http toolbox", | ||
@@ -34,3 +35,3 @@ "author": "Sergey Poskachey <seregynp@gmail.com>", | ||
], | ||
"gitHead": "9f86083862e66b5d34d2fdb6954bb3d6d7d563e4" | ||
"gitHead": "6c43d4cf33363d328e000d2e2b4dec997450a6ef" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18922
260
6
+ Added@libj/make-uri@1.1.15
+ Added@libj/http-meta@0.1.7(transitive)
+ Added@libj/logger@0.0.7(transitive)
+ Added@libj/make-uri@1.1.15(transitive)
- Removed@libj/http-meta@0.1.6(transitive)
- Removed@libj/logger@0.0.6(transitive)
Updated@libj/http-meta@0.1.7
Updated@libj/logger@0.0.7