QQGuildApi
表示为一个QQ频道的API。
通过 doRequest 发起一次请求。
日志
QQGuildApi 在进行请求的过程中会通过名称 love.forte.simbot.qguild.api
输出 DEBUG
日志,其中:
[ GET /foo/bar] =====> api.xxx.com, body: xxx
Content copied to clipboard
向右箭头的日志代表 request
相关的信息,
[ GET /foo/bar] <===== status: xxx, body: xxx
Content copied to clipboard
向左的日志则代表 response
相关的信息。
如果希望关闭日志中 request method
的染色,添加JVM参数
-Dsimbot.qguild.api.logger.color.enable=false
Content copied to clipboard
Inheritors
Functions
Link copied to clipboard
open suspend override fun doRequest(client: HttpClient, server: Url, token: String, decoder: StringFormat): R
使用此api发起一次请求,并得到预期中的结果。
Link copied to clipboard
使用此api发起一次请求,并得到响应结果的字符串。
Link copied to clipboard
当通过 doRequest 得到成功结果后进行的操作。
Link copied to clipboard
suspend fun <R> QQGuildApi<R>.request(client: HttpClient = QQGuildApi.DefaultHttpClient, server: Url, token: String, decoder: StringFormat = QQGuildApi.DefaultJsonDecoder): R
通过提供的参数,对此api进行请求并得到最终结果。
Link copied to clipboard
protected suspend fun requestForResponse(client: HttpClient, server: Url, token: String, json: Json = DefaultJsonDecoder): HttpResponse
Link copied to clipboard
protected inline suspend fun requestForText(client: HttpClient, server: Url, token: String, useResp: (HttpResponse) -> Unit = {}): String
通过 requestForResponse 得到响应,读取为文本并输出debug日志后返回。 不会进行校验。
Link copied to clipboard
suspend fun QQGuildApi<*>.requestRaw(client: HttpClient = QQGuildApi.DefaultHttpClient, server: Url, token: String): String
通过提供的参数,对此api进行请求并得到最终结果。
Link copied to clipboard
此请求对应的api路由路径以及路径参数。 例如:/guild/list