|
@@ -4,14 +4,14 @@ import { http } from '@kit.NetworkKit';
|
|
|
export interface HttpParamsGet {
|
|
export interface HttpParamsGet {
|
|
|
url: string
|
|
url: string
|
|
|
query?: Record<string, string> | Object
|
|
query?: Record<string, string> | Object
|
|
|
- headers?: Record<string, string | null | undefined>
|
|
|
|
|
|
|
+ headers?: Record<string, boolean | string | null | undefined>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export interface HttpParamsPost {
|
|
export interface HttpParamsPost {
|
|
|
url: string
|
|
url: string
|
|
|
data?: string | Object | ArrayBuffer
|
|
data?: string | Object | ArrayBuffer
|
|
|
query?: Record<string, string> | Object
|
|
query?: Record<string, string> | Object
|
|
|
- headers?: Record<string, string | null | undefined>
|
|
|
|
|
|
|
+ headers?: Record<string, boolean | string | null | undefined>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export interface HttpParamsUpload {
|
|
export interface HttpParamsUpload {
|
|
@@ -26,7 +26,7 @@ export interface HttpParamsForm {
|
|
|
url: string
|
|
url: string
|
|
|
data?: Record<string, string> | Object | undefined
|
|
data?: Record<string, string> | Object | undefined
|
|
|
query?: Record<string, string> | Object
|
|
query?: Record<string, string> | Object
|
|
|
- headers?: Record<string, string | null | undefined>
|
|
|
|
|
|
|
+ headers?: Record<string, boolean | string | null | undefined>
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export class HttpHelperX {
|
|
export class HttpHelperX {
|
|
@@ -36,7 +36,7 @@ export class HttpHelperX {
|
|
|
* @param headers
|
|
* @param headers
|
|
|
* @returns
|
|
* @returns
|
|
|
*/
|
|
*/
|
|
|
- static getHeaders(ct: string, headers?: Record<string, string>) {
|
|
|
|
|
|
|
+ static getHeaders(ct: string, headers?: Record<string, boolean | string>) {
|
|
|
return {
|
|
return {
|
|
|
"Content-Type": ct,
|
|
"Content-Type": ct,
|
|
|
// "Accept": "application/json",
|
|
// "Accept": "application/json",
|