ai_old/js/lib/http.ts
2024-09-20 16:50:35 +08:00

46 lines
1.8 KiB
TypeScript

// just for develop
export default {
get,
get2C,
head,
head2C,
post,
post2C,
put,
put2C,
delete:delete_,
delete2C,
do:do_,
do2C,
upload,
upload2C,
download,
download2C,
}
function get(url: string, headers?:Object): Result {return null}
function get2C(url: string, headers?:Object): Result {return null}
function head(url: string, headers?:Object): Result {return null}
function head2C(url: string, headers?:Object): Result {return null}
function post(url: string, data:Object, headers?:Object): Result {return null}
function post2C(url: string, data:Object, headers?:Object): Result {return null}
function put(url: string, data:Object, headers?:Object): Result {return null}
function put2C(url: string, data:Object, headers?:Object): Result {return null}
function delete_(url: string, data:Object, headers?:Object): Result {return null}
function delete2C(url: string, data:Object, headers?:Object): Result {return null}
function do_(method: string, url: string, data:Object, callback?:(data: string) => void, headers?:Object): Result {return null}
function do2C(method: string, url: string, data:Object, callback?:(data: string) => void, headers?:Object): Result {return null}
function upload(url: string, form:Object, files:Object, headers?:Object): Result {return null}
function upload2C(url: string, form:Object, files:Object, headers?:Object): Result {return null}
function download(filename: string, url: string, callback?:(finished: number, total: number) => void, headers?:Object): Result {return null}
function download2C(filename: string, url: string, callback?:(finished: number, total: number) => void, headers?:Object): Result {return null}
interface Result {
status: string
statusCode: number
headers: Object
data: Object
result: string
}