当前位置: 首页 > news >正文

建站快车是什么怎么做网站策划

建站快车是什么,怎么做网站策划,免费企业网站认证,网站更改了资料 百度什么时侯来抓取目录 一、前情回顾二、HttpLoggingInterceptor1、HttpLoggingInterceptor拦截器是做什么的#xff1f;2、如何使用HttpLoggingInterceptor#xff1f;2.1 日志级别2.2 如何看日志#xff1f;2.2.1 日志级别#xff1a;BODY2.2.2 日志级别#xff1a;BASIC2.2.3 日志级别2、如何使用HttpLoggingInterceptor2.1 日志级别2.2 如何看日志2.2.1 日志级别BODY2.2.2 日志级别BASIC2.2.3 日志级别HEADERS2.2.4 日志级别NONE 一、前情回顾 在“认识并使用OkHttp3”中提到“OkHttp的拦截器也要学习下~”这篇文章就来学习下HttpLoggingInterceptor这个拦截器。 二、HttpLoggingInterceptor 1、HttpLoggingInterceptor拦截器是做什么的 HttpLoggingInterceptor是OkHttp3提供的一个拦截器主要用于记录HTTP请求和响应的详细信息包括请求的URL、方法、头部信息以及响应的状态码、响应体等内容。下文会结合具体例子详细说明 2、如何使用HttpLoggingInterceptor 代码示例 // 创建日志拦截器实例并设置日志级别 HttpLoggingInterceptor logging new HttpLoggingInterceptor(); logging.setLevel(Level.BODY);// 创建OkHttpClient并添加拦截器 OkHttpClient client new OkHttpClient.Builder().addInterceptor(logging).build();2.1 日志级别 HttpLoggingInterceptor允许指定日志的级别来控制需要记录的详细程度包括 NONE不记录任何日志。BASIC记录请求类型、URL、响应状态码以及响应时间。HEADERS记录请求和响应的头部信息以及BASIC级别的信息。BODY记录请求和响应的头部信息、body内容以及BASIC级别的信息。注意记录body内容可能会消耗资源并且会读取body数据这可能会影响请求的执行。 这其实对应的就是请求/响应的三部分。 请求 请求行请求头Header请求体 (Body) 响应 状态行响应头响应体 2.2 如何看日志 2.2.1 日志级别BODY 示例 二月 17, 2024 9:04:42 下午 okhttp3.internal.platform.Platform log 信息: -- POST https://api.openai.com/v1/chat/completions 二月 17, 2024 9:04:42 下午 okhttp3.internal.platform.Platform log 信息: Content-Type: application/json; charsetutf-8 二月 17, 2024 9:04:42 下午 okhttp3.internal.platform.Platform log 信息: Content-Length: 197 二月 17, 2024 9:04:42 下午 okhttp3.internal.platform.Platform log 信息: Authorization: Bearer xxx 二月 17, 2024 9:04:42 下午 okhttp3.internal.platform.Platform log 信息: 二月 17, 2024 9:04:42 下午 okhttp3.internal.platform.Platform log 信息: {messages:[{content:1 1 ?,role:user}],model:gpt-3.5-turbo-0613,n:1,stream:false,temperature:1.0,frequency_penalty:0.0,max_tokens:2048,presence_penalty:0.0,top_p:1.0} 二月 17, 2024 9:04:42 下午 okhttp3.internal.platform.Platform log 信息: -- END POST (197-byte body) 二月 17, 2024 9:04:43 下午 okhttp3.internal.platform.Platform log 信息: -- 200 https://api.openai.com/v1/chat/completions (1599ms) 二月 17, 2024 9:04:43 下午 okhttp3.internal.platform.Platform log 信息: date: Sat, 17 Feb 2024 13:04:43 GMT 二月 17, 2024 9:04:43 下午 okhttp3.internal.platform.Platform log 信息: content-type: application/json ...... 二月 17, 2024 9:04:43 下午 okhttp3.internal.platform.Platform log 信息: 二月 17, 2024 9:04:43 下午 okhttp3.internal.platform.Platform log 信息: {id: chatcmpl-8tEexggs1EAHChI6OAhJAIyqCVjxg,object: chat.completion,created: 1708175083,model: gpt-3.5-turbo-0613,choices: [{index: 0,message: {role: assistant,content: 1 1 2},logprobs: null,finish_reason: stop}],usage: {prompt_tokens: 13,completion_tokens: 7,total_tokens: 20},system_fingerprint: null }二月 17, 2024 9:04:43 下午 okhttp3.internal.platform.Platform log 信息: -- END HTTP (458-byte body)2.2.2 日志级别BASIC 示例 二月 17, 2024 9:52:49 下午 okhttp3.internal.platform.Platform log 信息: -- POST https://api.openai.com/v1/chat/completions (197-byte body) 二月 17, 2024 9:52:51 下午 okhttp3.internal.platform.Platform log 信息: -- 200 https://api.openai.com/v1/chat/completions (1879ms, unknown-length body)2.2.3 日志级别HEADERS 示例 二月 17, 2024 9:54:37 下午 okhttp3.internal.platform.Platform log 信息: -- POST https://api.openai.com/v1/chat/completions 二月 17, 2024 9:54:37 下午 okhttp3.internal.platform.Platform log 信息: Content-Type: application/json; charsetutf-8 二月 17, 2024 9:54:37 下午 okhttp3.internal.platform.Platform log 信息: Content-Length: 197 二月 17, 2024 9:54:37 下午 okhttp3.internal.platform.Platform log 信息: Authorization: Bearer xxx 二月 17, 2024 9:54:37 下午 okhttp3.internal.platform.Platform log 信息: -- END POST 二月 17, 2024 9:54:39 下午 okhttp3.internal.platform.Platform log 信息: -- 200 https://api.openai.com/v1/chat/completions (1756ms) 二月 17, 2024 9:54:39 下午 okhttp3.internal.platform.Platform log 信息: date: Sat, 17 Feb 2024 13:54:39 GMT 二月 17, 2024 9:54:39 下午 okhttp3.internal.platform.Platform log 信息: content-type: application/json ... 二月 17, 2024 9:54:39 下午 okhttp3.internal.platform.Platform log 信息: -- END HTTP2.2.4 日志级别NONE 没有任何的日志。那还不如别添加这个拦截器。 从调试和监控HTTP调用的角度我会选日志级别BODY。
http://www.dnsts.com.cn/news/141405.html

相关文章:

  • 临县网站建设军事新闻最新24小时
  • 网站开发与app开发原理整合营销中的4c指的是什么
  • 怎么用htlm5自己做网站建设旅游网站的价值
  • 网站建设运行情况简介吕子乔做网站吹的语录
  • 口碑好的做网站哈尔滨视频剪辑培训机构
  • 程序员个人网站开发asp.net网站开发实战
  • 网站后台模板 下载什么平台免费推广效果最好
  • 51ape是谁做的网站广州网络营销系统
  • 平面设计工作室网站网络营销的特点包括超前性
  • 大型免费网站制作深圳包装设计公司排名前十强
  • 仿织梦小说网站源码短网址免费生成
  • 网站 短链接怎么做微信的企业网站模板
  • 电商平台网站运营方案外贸网站建设方案
  • 特色食品网站建设策划书上海网络推广部
  • 公司做网站最好怎么进行网站推广
  • 留学生做留服证明在哪个网站安徽省建设工程资料上传网站
  • 常用网站字体网站制作方案中哪几个点比较重要
  • 做网站好公司哪家好北京建网站的公司哪个比较好
  • 室内设计效果图手绘图片大全朝阳网站seo
  • 点广告挣钱网站有哪些品牌网站建设优化公司哪家好
  • 建湖专业做网站创建网站运营费用
  • 做网站蓝色和什么颜色搭配好看ui和前端哪个前景好
  • 网站框架图中国空间站图片
  • 武冈市住房和城乡建设局网站广告投放跟网站建设一样吗
  • 网站游戏正规网站建设wordpress 海报
  • 做网站如何网站考虑优化网站做百度推广
  • 建设银行网站登陆不上去重庆广告公司网站建设
  • 湖南省网站建设项目纯注册app拉新挣钱
  • 个人设计师的网站网站开发摊销期
  • 网站建设工作流程营销团队外包