@azure-net/kit 3.0.51 → 3.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -48,7 +48,7 @@ export interface IHttpServiceInstance {
|
|
|
48
48
|
readonly stop: typeof stop;
|
|
49
49
|
}
|
|
50
50
|
export declare class HttpService {
|
|
51
|
-
private
|
|
51
|
+
private baseUrl;
|
|
52
52
|
private readonly instance;
|
|
53
53
|
private readonly requestHandler?;
|
|
54
54
|
private readonly errorHandler?;
|
|
@@ -61,6 +61,7 @@ export declare class HttpService {
|
|
|
61
61
|
onError?: (err: IHttpServiceError) => HttpServiceError<unknown>;
|
|
62
62
|
handleError?: (err: unknown) => Promise<HttpServiceError<unknown>>;
|
|
63
63
|
});
|
|
64
|
+
setBaseUrl(newBaseUrl: string): void;
|
|
64
65
|
private prepareOptions;
|
|
65
66
|
private prepareResponse;
|
|
66
67
|
post<T>(url: string, options?: IHttpServiceOptions): Promise<IHttpServiceResponse<T>>;
|
|
@@ -42,6 +42,9 @@ export class HttpService {
|
|
|
42
42
|
this.requestHandler = opts?.onRequest ?? undefined;
|
|
43
43
|
this.globalErrorHandler = opts?.handleError ?? undefined;
|
|
44
44
|
}
|
|
45
|
+
setBaseUrl(newBaseUrl) {
|
|
46
|
+
this.baseUrl = newBaseUrl;
|
|
47
|
+
}
|
|
45
48
|
async prepareOptions(requestOptions) {
|
|
46
49
|
const options = typeof requestOptions === 'object' ? { ...requestOptions } : {};
|
|
47
50
|
if (this.requestHandler) {
|