猫史档案馆


【api透露】 http.fetch用法

用户:没尾巴的鲸鱼_没尾巴的鲸鱼_查看:1 回复:11 评论:1 创建时间:2023-09-23T16:22:25


最近扒岛三API声明文件,发现了访问网站的接口

fetch: (url: string, options?: GameHttpFetchRequestOptions) => Promise<GameHttpFetchResponse>;
发现:
http.fetch​
函数需要参数url:string,options参数则是一个对象:
{
    timeout?: number; //超时
    method?: 'OPTIONS' | 'GET' | 'HEAD' | 'PUT' | 'POST' | 'DELETE' | 'PATCH'; //请求方法
    headers?: GameHttpFetchHeaders; //请求头
    body?: string | ArrayBuffer; //请求体
};​
其中,GameHttpFetchHeaders(请求头)定义为:
[name: string]: string | string[];
  随后,fetch方喵返回对象GameHttpFetchResponse:
declare class GameHttpFetchResponse {
    status: number;
    statusText: string;
    headers: GameHttpFetchHeaders;
    json: () => Promise<any>;
    text: () => Promise<string>;
    arrayBuffer: () => Promise<ArrayBuffer>;
    close: () => Promise<void>;
    constructor(status: number, statusText: string, headers: GameHttpFetchHeaders, json: () => Promise<any>, text: () => Promise<string>, arrayBuffer: () => Promise<ArrayBuffer>, close: () => Promise<void>);
    get ok(): boolean;
}

其中,status返回状态码;

json()返回对象数据;

text()返回文字数据;

close()方法关闭连接;

成员ok为布尔值,返回是否连接成功。

以上就是http隐藏API的用法,各位自取!将会持续更新API透露!


回复

上一页1 页 / 共 1下一页
没尾巴的鲸鱼_没尾巴的鲸鱼_

顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶喵

点赞0


评论


没尾巴的鲸鱼_没尾巴的鲸鱼_

顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶

点赞0


评论


yee剑走天下yee剑走天下

所以怎么用()而且一用就报错(

点赞0


评论


SCS_user_LoeheodVOQSCS_user_LoeheodVOQ

好像是有白名单

点赞0


评论


FML饭米粒FML饭米粒

去瞅瞅那个whitelist是啥玩意

点赞0


评论


86135cIc86135cIc

我早在几个月前研究过了

点赞0


评论


aOrangesoftaOrangesoft

懂了,反正是同源,火速进行网络攻防

点赞1


评论


我是派对客我是派对客

顶顶顶

点赞0


评论


没尾巴的鲸鱼_没尾巴的鲸鱼_

喵喵喵喵喵喵

点赞0


评论


没尾巴的鲸鱼_没尾巴的鲸鱼_

d'd'd'd'd'd'd'd'd'd'd'd

点赞0


评论


没尾巴的鲸鱼_没尾巴的鲸鱼_

d'd'd'd'd'd'd'd'd'd'd'd

点赞0


评论