Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >专栏 >SQLServer采集data和log的体积推送到prometheus

SQLServer采集data和log的体积推送到prometheus

原创
作者头像
保持热爱奔赴山海
发布于 2024-10-01 01:25:37
发布于 2024-10-01 01:25:37
9500
代码可运行
举报
文章被收录于专栏:数据库相关数据库相关
运行总次数:0
代码可运行

“为什么你的 RAG 应用总像个复读机?”

当大多数 AI 应用还在用 RAG 模式机械地检索-回答时,Elastic AI Assistant 已经像人类工程师一样拆解任务、调用工具、迭代验证——这一切的秘密,藏在它近乎“代码级严谨”的 System Prompt 设计中。

今天,我们将解剖这份官方 Prompt 模板,看它如何通过 工具链编排 和 状态机约束,让 LLM 摆脱“一次性生成”的局限,进化成能真正操作复杂系统的 Agent RAG


一、Agentic RAG 与 RAG 的核心差异

1. 任务处理模式

类型

处理模式

典型架构

适用场景

RAG

单轮检索-生成(Retrieve-Generate)

检索文档 → 生成答案

简单问答、知识查询

Agentic RAG

多步规划-执行(Plan-Act)

任务分解 → 工具调用 → 迭代

复杂操作、系统诊断、分析

2. Elastic AI Assistant 的 Prompt 设计关键点

以下,是 Elastic AI Assistant 的 System Prompt核心片段:

代码语言:json
AI代码解释
复制
{
 'messages': [{
        'role': 'system',
        'content': 'You are a helpful assistant for Elastic Observability. Your goal is to help the Elastic Observability users to quickly assess what is happening in their observed systems. You can help them visualise and analyze data, investigate their systems, perform root cause analysis or identify optimisation opportunities.\n\n    It\'s very important to not assume what the user is meaning. Ask them for clarification if needed.\n\n    If you are unsure about which function should be used and with what arguments, ask the user for clarification or confirmation.\n\n    In KQL ("kqlFilter")) escaping happens with double quotes, not single quotes. Some characters that need escaping are: \':()\\    /". Always put a field value in double quotes. Best: service.name:"opbeans-go". Wrong: service.name:opbeans-go. This is very important!\n\n    You can use Github-flavored Markdown in your responses. If a function returns an array, consider using a Markdown table to format the response.\n\n    Note that ES|QL (the Elasticsearch Query Language which is a new piped language) is the preferred query language.\n\n    If you want to call a function or tool, only call it a single time per message. Wait until the function has been executed and its results\n    returned to you, before executing the same tool or another tool again if needed.\n\n    DO NOT UNDER ANY CIRCUMSTANCES USE ES|QL syntax (service.name == "foo") with "kqlFilter" (service.name:"foo").\n\n    The user is able to change the language which they want you to reply in on the settings page of the AI Assistant for Observability and Search, which can be found in the Stack Management app under the option AI Assistants.\n    If the user asks how to change the language, reply in the same language the user asked in.\n\nYou MUST use the "query" function when the user wants to:\n  - visualize data\n  - run any arbitrary query\n  - breakdown or filter ES|QL queries that are displayed on the current page\n  - convert queries from another language to ES|QL\n  - asks general questions about ES|QL\n\n  DO NOT UNDER ANY CIRCUMSTANCES generate ES|QL queries or explain anything about the ES|QL query language yourself.\n  DO NOT UNDER ANY CIRCUMSTANCES try to correct an ES|QL query yourself - always use the "query" function for this.\n\n  If the user asks for a query, and one of the dataset info functions was called and returned no results, you should still call the query function to generate an example query.\n\n  Even if the "query" function was used before that, follow it up with the "query" function. If a query fails, do not attempt to correct it yourself. Again you should call the "query" function,\n  even if it has been called before.\n\n  When the "visualize_query" function has been called, a visualization has been displayed to the user. DO NOT UNDER ANY CIRCUMSTANCES follow up a "visualize_query" function call with your own visualization attempt.\n  If the "execute_query" function has been called, summarize these results for the user. The user does not see a visualization in this case.\n\nYou MUST use the "get_dataset_info"  function before calling the "query" or the "changes" functions.\n\nIf a function requires an index, you MUST use the results from the dataset info functions.\n\nYou do not have a working memory. If the user expects you to remember the previous conversations, tell them they can set up the knowledge base.\n\nWhen asked questions about the Elastic stack or products, You should use the retrieve_elastic_doc function before answering,\n      to retrieve documentation related to the question. Consider that the documentation returned by the function\n      is always more up to date and accurate than any own internal knowledge you might have.'
    }, {
        'role': 'user',
        'content': 'Hi'
    }, {
        'role': 'assistant',
        'content': '',
        'function_call': {
            'name': 'context',
            'arguments': '{}'
        }
    }, {
        'role': 'user',
        'content': '{"screen_description":"The user is looking at http://localhost:5601/app/observabilityAIAssistant/conversations/new. The current time range is 2025-03-10T07:30:39.405Z - 2025-03-10T07:45:39.405Z.","learnings":[]}',
        'name': 'context'
    }],
    'stream': True,
    'tools': [{
        'function': {
            'name': 'query',
            'description': "This function generates, executes and/or visualizes a query\n      based on the user's request. It also explains how ES|QL works and how to\n      convert queries from one language to another. Make sure you call one of\n      the get_dataset functions first if you need index or field names. This\n      function takes no input.",
            'parameters': {
                'type': 'object',
                'properties': {}
            }
        },
        'type': 'function'
    }, {
        'function': {
            'name': 'get_alerts_dataset_info',
            'description': 'Use this function to get information about alerts data.',
            'parameters': {
                'type': 'object',
                'properties': {
                    'start': {
                        'type': 'string',
                        'description': 'The start of the current time range, in datemath, like now-24h or an ISO timestamp'
                    },
                    'end': {
                        'type': 'string',
                        'description': 'The end of the current time range, in datemath, like now-24h or an ISO timestamp'
                    }
                }
            }
        },
        'type': 'function'
    }, {
        'function': {
            'name': 'alerts',
            'description': 'Get alerts for Observability.  Make sure get_alerts_dataset_info was called before.\n        Use this to get open (and optionally recovered) alerts for Observability assets, like services,\n        hosts or containers.\n        Display the response in tabular format if appropriate.\n      ',
            'parameters': {
                'type': 'object',
                'properties': {
                    'start': {
                        'type': 'string',
                        'description': 'The start of the time range, in Elasticsearch date math, like now.'
                    },
                    'end': {
                        'type': 'string',
                        'description': 'The end of the time range, in Elasticsearch date math, like now-24h.'
                    },
                    'kqlFilter': {
                        'type': 'string',
                        'description': 'Filter alerts by field:value pairs'
                    },
                    'includeRecovered': {
                        'type': 'boolean',
                        'description': 'Whether to include recovered/closed alerts. Defaults to false, which means only active alerts will be returned'
                    }
                },
                'required': ['start', 'end']
            }
        },
        'type': 'function'
    }, {
        'function': {
            'name': 'changes',
            'description': 'Returns change points like spikes and dips for logs and metrics.',
            'parameters': {
                'type': 'object',
                'properties': {
                    'start': {
                        'type': 'string',
                        'description': 'The beginning of the time range, in datemath, like now-24h, or an ISO timestamp'
                    },
                    'end': {
                        'type': 'string',
                        'description': 'The end of the time range, in datemath, like now, or an ISO timestamp'
                    },
                    'logs': {
                        'description': 'Analyze changes in log patterns. If no index is given, the default logs index pattern will be used',
                        'type': 'array',
                        'items': {
                            'type': 'object',
                            'properties': {
                                'name': {
                                    'type': 'string',
                                    'description': 'The name of this set of logs'
                                },
                                'index': {
                                    'type': 'string',
                                    'description': 'The index or index pattern where to find the logs'
                                },
                                'kqlFilter': {
                                    'type': 'string',
                                    'description': 'A KQL filter to filter the log documents by, e.g. my_field:foo'
                                },
                                'field': {
                                    'type': 'string',
                                    'description': 'The text field that contains the message to be analyzed, usually message. ONLY use field names from the conversation.'
                                }
                            },
                            'required': ['name']
                        }
                    },
                    'metrics': {
                        'description': 'Analyze changes in metrics. DO NOT UNDER ANY CIRCUMSTANCES use date or metric fields for groupBy, leave empty unless needed.',
                        'type': 'array',
                        'items': {
                            'type': 'object',
                            'properties': {
                                'name': {
                                    'type': 'string',
                                    'description': 'The name of this set of metrics'
                                },
                                'index': {
                                    'type': 'string',
                                    'description': 'The index or index pattern where to find the metrics'
                                },
                                'kqlFilter': {
                                    'type': 'string',
                                    'description': 'A KQL filter to filter the log documents by, e.g. my_field:foo'
                                },
                                'field': {
                                    'type': 'string',
                                    'description': 'Metric field that contains the metric. Only use if the metric aggregation type is not count.'
                                },
                                'type': {
                                    'type': 'string',
                                    'description': 'The type of metric aggregation to perform. Defaults to count',
                                    'enum': ['count', 'avg', 'sum', 'min', 'max', 'p95', 'p99']
                                },
                                'groupBy': {
                                    'type': 'array',
                                    'description': 'Optional keyword fields to group metrics by.',
                                    'items': {
                                        'type': 'string'
                                    }
                                }
                            },
                            'required': ['index', 'name']
                        }
                    }
                },
                'required': ['start', 'end']
            }
        },
        'type': 'function'
    }, {
        'function': {
            'name': 'elasticsearch',
            'description': 'Call Elasticsearch APIs on behalf of the user. Make sure the request body is valid for the API that you are using. Only call this function when the user has explicitly requested it.',
            'parameters': {
                'type': 'object',
                'properties': {
                    'method': {
                        'type': 'string',
                        'description': 'The HTTP method of the Elasticsearch endpoint',
                        'enum': ['GET', 'PUT', 'POST', 'DELETE', 'PATCH']
                    },
                    'path': {
                        'type': 'string',
                        'description': 'The path of the Elasticsearch endpoint, including query parameters'
                    },
                    'body': {
                        'type': 'object',
                        'description': 'The body of the request'
                    }
                },
                'required': ['method', 'path']
            }
        },
        'type': 'function'
    }, {
        'function': {
            'name': 'kibana',
            'description': 'Call Kibana APIs on behalf of the user. Only call this function when the user has explicitly requested it, and you know how to call it, for example by querying the knowledge base or having the user explain it to you. Assume that pathnames, bodies and query parameters may have changed since your knowledge cut off date.',
            'parameters': {
                'type': 'object',
                'properties': {
                    'method': {
                        'type': 'string',
                        'description': 'The HTTP method of the Kibana endpoint',
                        'enum': ['GET', 'PUT', 'POST', 'DELETE', 'PATCH']
                    },
                    'pathname': {
                        'type': 'string',
                        'description': 'The pathname of the Kibana endpoint, excluding query parameters'
                    },
                    'query': {
                        'type': 'object',
                        'description': 'The query parameters, as an object'
                    },
                    'body': {
                        'type': 'object',
                        'description': 'The body of the request'
                    }
                },
                'required': ['method', 'pathname']
            }
        },
        'type': 'function'
    }, {
        'function': {
            'name': 'get_dataset_info',
            'description': 'Use this function to get information about indices/datasets available and the fields available on them.\n\n      providing empty string as index name will retrieve all indices\n      else list of all fields for the given index will be given. if no fields are returned this means no indices were matched by provided index pattern.\n      wildcards can be part of index name.',
            'parameters': {
                'type': 'object',
                'properties': {
                    'index': {
                        'type': 'string',
                        'description': 'index pattern the user is interested in or empty string to get information about all available indices'
                    }
                },
                'required': ['index']
            }
        },
        'type': 'function'
    }, {
        'function': {
            'name': 'execute_connector',
            'description': 'Use this function when user explicitly asks to call a kibana connector.',
            'parameters': {
                'type': 'object',
                'properties': {
                    'id': {
                        'type': 'string',
                        'description': 'The id of the connector'
                    },
                    'params': {
                        'type': 'object',
                        'description': 'The connector parameters'
                    }
                },
                'required': ['id', 'params']
            }
        },
        'type': 'function'
    }, {
        'function': {
            'name': 'retrieve_elastic_doc',
            'description': 'Use this function to retrieve documentation about Elastic products.\n      You can retrieve documentation about the Elastic stack, such as Kibana and Elasticsearch,\n      or for Elastic solutions, such as Elastic Security, Elastic Observability or Elastic Enterprise Search\n      ',
            'parameters': {
                'type': 'object',
                'properties': {
                    'query': {
                        'description': 'The query to use to retrieve documentation\n            Examples:\n            - "How to enable TLS for Elasticsearch?"\n            - "What is Kibana Lens?"',
                        'type': 'string'
                    },
                    'product': {
                        'description': 'If specified, will filter the products to retrieve documentation for\n            Possible options are:\n            - "kibana": Kibana product\n            - "elasticsearch": Elasticsearch product\n            - "observability": Elastic Observability solution\n            - "security": Elastic Security solution\n            If not specified, will search against all products\n            ',
                        'type': 'string',
                        'enum': ['kibana', 'elasticsearch', 'observability', 'security']
                    }
                },
                'required': ['query']
            }
        },
        'type': 'function'
    }],
    'temperature': 0
}

从该 Prompt 中,我们可以看到以下关键设计:

代码语言:python
代码运行次数:0
运行
AI代码解释
复制
# 系统指令强制分步执行
'system': '''
- 必须优先调用 `get_dataset_info` 获取元数据,再调用 `query` 执行查询
- 禁止自行生成 ES|QL 查询,必须通过工具调用
- 每次只能调用一个函数,需等待返回结果后再继续
'''

这本质上构建了一个 有限状态机,强制 Agentic RAG 按步骤操作。


二、为什么 Agentic RAG 能实现多步处理?

1. 工具链驱动的工作流

Elastic AI Assistant 的 Prompt 中定义了 7 个核心工具

代码语言:python
代码运行次数:0
运行
AI代码解释
复制
'tools': [
    {'name': 'query', 'desc': '执行查询'},          # 查询执行
    {'name': 'get_dataset_info', 'desc': '获取元数据'}, # 元数据获取
    {'name': 'alerts', 'desc': '告警处理'},         # 告警操作
    {'name': 'changes', 'desc': '变更分析'},        # 变更检测
    {'name': 'elasticsearch', 'desc': '直接调用 ES API'}, # 底层操作
    {'name': 'kibana', 'desc': '调用 Kibana API'},  # 可视化扩展
    {'name': 'retrieve_elastic_doc', 'desc': '文档检索'} # 知识增强
]

通过工具组合,Agentic RAG 可以按需调用不同功能,形成工作流。

2. 严格的执行约束

Prompt 中通过规则限制行为:

代码语言:python
代码运行次数:0
运行
AI代码解释
复制
# 禁止 Agentic RAG 自由发挥
'DO NOT UNDER ANY CIRCUMSTANCES generate ES|QL queries yourself'
'If a query fails, do not attempt to correct it yourself. Call the "query" function again'

这种约束将 LLM 的「创造力」限制在安全边界内,确保操作可控。


三、对比:RAG 的局限性

1. 单轮处理的本质缺陷

RAG 的典型流程:

代码语言:bash
AI代码解释
复制
用户问题 → 检索文档 → 生成答案(End)

缺少:

  • 状态保持:无法记录中间结果
  • 工具调用:无法执行实际操作(如调用 ES 的 query 函数)
  • 错误恢复:一次失败即终止
2. 知识依赖 vs 操作能力

能力

RAG

Agentic RAG

知识检索

✔️ 强(文档级)

✔️ 弱(工具元数据)

系统操作

❌ 无

✔️ 强(API 调用)

多步推理

❌ 无

✔️ 强(状态迭代)


四、Elastic AI Assistant 的运作原理

1. 步骤分解示例

假设用户问:“分析过去 24 小时的服务错误日志”

  1. Step 1:调用 get_dataset_info 获取日志索引结构
  2. Step 2:调用 query 生成 ES|QL 查询
  3. Step 3:调用 changes 检测异常时间点
  4. Step 4:调用 alerts 创建告警规则
2. 错误处理机制

当某一步失败时:

代码语言:python
代码运行次数:0
运行
AI代码解释
复制
# Prompt 中明确规定
'If a query fails, do not attempt to correct it yourself. Again call the "query" function'

Agentic RAG 会重新调用工具,而不是尝试自行修复,避免幻觉。


五、关键设计总结

设计维度

Elastic AI Assistant 的实现

RAG 的对比

任务分解

通过工具链强制分步执行

单轮处理,无分解能力

状态管理

依赖外部系统记录中间结果(如 Kibana 的时序数据)

无状态

安全性

禁止 LLM 直接生成查询,通过工具隔离风险

直接生成答案,风险较高

扩展性

可通过新增工具(如 execute_connector)扩展功能

仅限文档检索


六、对 LLM 的要求差异

1. RAG 的 LLM 需求
  • 强生成能力:直接输出最终答案
  • 知识覆盖面广:依赖训练数据的完整性
2. Agentic RAG 的 LLM 需求
  • 工具理解能力:准确选择调用函数
  • 流程控制能力:管理多步状态转移
  • 低幻觉倾向:严格遵守 Prompt 约束

从 Elastic 的 Prompt 中可以看到,其系统指令通过 高频强调规则(如 5 次出现 DO NOT UNDER ANY CIRCUMSTANCES)来抑制 LLM 的随意性。


七、性能与成本权衡

指标

Agentic RAG 模式

RAG 模式

响应延迟

高(多轮交互)

低(单轮响应)

开发成本

高(需设计工具链和状态机)

低(仅需检索器+生成器)

可控性

高(精准控制每一步)

低(黑盒生成)


总结

Elastic AI Assistant 的 Prompt 设计展示了一个典型 工具驱动型 Agentic RAG 的实现,其通过:

  1. 严格的功能约束 抑制 LLM 幻觉
  2. 工具链组合 实现复杂操作
  3. 状态迭代 完成多步任务

而 RAG 的「单轮」特性本质上是其设计目标的产物——快速知识检索,而非系统操作。两者在底层架构和设计哲学上存在根本差异,尽管可能共享同一个 LLM 基座。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
⚡3分钟⚡熟悉面试常问状态码,面试官都听呆了
· 100 - Continue 初始的请求已经接受,客户应当继续发送请求的其余部分。(HTTP 1.1新) · 101 - Switching Protocols 服务器将遵从客户的请求转换到另外一种协议(HTTP 1.1新)
江一铭
2022/06/16
1.9K0
⚡3分钟⚡熟悉面试常问状态码,面试官都听呆了
HTTP状态码及其含义
        开发Web项目的时候,因为环境搭建和配置的原因,经常会出现部署失败的情况;搭建这个博客的时候,也因为php-admin缺少某些库的原因,导致出现502的稀有的http状态。平时不是很留意这些状态码信息,也不是很了解出现这种状态的内在原因,每次出现都要查找。为了详细梳理和备忘,整理一份http状态码及其含义的解析。
王金龙
2018/09/05
1.8K0
2022秋招前端面试题(五)(附答案)
用CSS实现扇形的思路和三角形基本一致,就是多了一个圆角的样式,实现一个90°的扇形:
helloworld1024
2022/08/08
5540
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。
猿天地
2019/12/18
1.9K0
程序员:我终于知道post和get的区别
前端面试题
解决了创建多个相似对象的问题,但没有解决对象识别的问题。也就是说我们无法知道创建出来的对象类型。
用户7162790
2022/03/23
7150
来聊聊 HTTP 如何
  万维网 WWW(world wide web) 发源于欧洲日内瓦量子物理实验室 CERN,正是 WWW 技术的出现使得因特网得以超乎想象的速度迅猛发展。这项基于 TCP/IP 的技术在短短的十年时间内迅速成为已经发展了几十年的 Internet 上的规模最大的信息系统,它的成功归结于它的简单、实用。在 WWW 的背后有一系列的协议和标准支持它完成如此宏大的工作,这就是 Web 协议族,其中就包括 HTTP 超文本传输协议。   在 1990 年,HTTP 就成为 WWW 的支撑协议。当时由其创始人 WWW 之父蒂姆·贝纳斯·李(TimBerners—Lee) 提出,随后 WWW 联盟(WWW Consortium)成立,组织了 IETF(Internet Engineering Task Force)小组进一步完善和发布 HTTP 协议。   HTTP 是应用层协议,同其他应用层协议一样,是为了实现某一类具体应用的协议,并由某一运行在用户空间的应用程序来实现其功能。HTTP 是一种协议规范,这种规范记录在文档上,为真正通过 HTTP 协议进行通信的 HTTP 的实现程序。   HTTP 协议是基于 C/S 架构进行通信的,而 HTTP 协议的服务器端实现程序有 httpd、nginx 等,其客户端的实现程序主要是 Web 浏览器,例如 Firefox、InternetExplorer、Google chrome、Safari、Opera 等,此外,客户端的命令行工具还有 elink、curl 等。Web 服务是基于 TCP 的,因此为了能够随时响应客户端的请求,Web 服务器需要监听在 80/TCP 端口。这客户端浏览器和 Web 服务器之间就可以通过 HTTP 协议进行通信了。
Demo_Null
2020/09/28
5380
来聊聊 HTTP 如何
面试突击53:常见的 HTTP 状态码有哪些?
HTTP 状态码是服务器端返回给客户端的响应状态码,根据(HTTP)状态码我们就能知道服务器端想要给客户端表达的具体含义,比如 200 就表示请求访问成功,500 就表示服务器端程序出错等。 HTTP 状态码可分为 5 大类:
磊哥
2022/06/02
6330
http码类型状态表
当浏览者访问一个网页时,浏览者的浏览器会向网页所在服务器发出请求。当浏览器接收并显示网页前,此网页所在的服务器会返回一个包含 HTTP 状态码的信息头(server header)用以响应浏览器的请求。
炒香菇的书呆子
2021/03/16
1K1
http码类型状态表
基于Django的电子商务网站开发(连载5)
HTTP的请求方式共分为OPTIONS、GET、HEAD、POST、PUT、DELETE、TRACE和CONNECT八种(注意:这些方法均为大写),其中比较常用的为GET和POST。
顾翔
2019/12/11
8730
基于Django的电子商务网站开发(连载5)
常用 HTTP 状态码
HTTP 100 Continue 信息型状态响应码表示目前为止一切正常,客户端应该继续请求,如果已完成请求则忽略。
雨落秋垣
2024/10/29
1930
HTTP协议概述
HTTP1.0定义了三种请求方法:GET、POST、HEAD方法。 HTTP1.1新增了六种请求方法:OPTIONS、PUT、PATCH、DELETE、TRACE和CONNECT方法。
WindRunnerMax
2020/08/27
7100
前端高频面试题(五)(附答案)
题目描述:JS 实现一个带并发限制的异步调度器 Scheduler,保证同时运行的任务最多有两个
helloworld1024
2022/09/01
7390
剖析 HTTP 协议
HTTP 概述 HTTP 是什么? HTTP(HyperText Transfer Protocol,超文本传输协议)是WWW (World Wide Web)实现数据通信的基石。 HTTP是由IET
静默虚空
2018/01/05
9230
剖析 HTTP 协议
记录一下 http status code
一般查询我们都会使用 GET 方法, 创建新的记录使用 POST 方法 更新已有数据使用 PUT 方法 更新已有数据部分属性使用 PATCH 方法 删除已有数据使用 DELETE 方法
用户7053485
2020/06/19
1.3K0
HTTP和HTTPS是什么 二者区别是什么
HTTP(超文本传输协议)是网络上最为广泛的传输协议,被用于在web浏览器和网站服务器之间的传输协议。HTTP是一个简单的请求-响应协议,它通常运行在TCP之上。它指定了客户端可能发送给服务器什么样的消息以及得到什么样的响应。请求和响应消息的头以ASCII形式给出;而消息内容则具有一个类似MIME的格式。这个简单模型是早期Web成功的有功之臣,因为它使开发和部署非常地直截了当。
肥晨
2022/09/27
7660
HTTP和HTTPS是什么 二者区别是什么
四、《图解HTTP》- 状态码
状态码章节内容过于贫乏,参考资料找了一个澳大利亚的博客,里面收录了HTTP的状态码介绍,为什么选这个作参考?一个是网站挺漂亮,另一个是做了一张长图容纳了常见的响应码,存到手机可以时不时看看,并且博客有做国际化,点进去自动就是中文(但是团队确实是外国人),挺有意思的。
阿东
2022/08/12
1.2K0
四、《图解HTTP》- 状态码
超全的HTTP请求响应码详细解析
HTTP响应状态码表 1xx: 信息 状态码 英文 描述 100 Continue 服务器仅接收到部分请求,但是一旦服务器并没有拒绝该请求,客户端应该继续发送其余的请求。 101 Switching Protocols 服务器转换协议:服务器将遵从客户的请求转换到另外一种协议。 2xx: 成功 状态码 英文 描述 200 OK 请求成功(其后是对GET和POST请求的应答文档) 201 Created 请求被创建完成,同时新的资源被创建。 202 Accepted 供处理的请求已被接受,但是处理未完成。
python鱼霸霸
2020/05/04
1.7K0
C++ CGIweb编程
超文本传输协议就是所谓的HTTP,是一个简单的请求-响应协议,它通常运行在TCP之上。它指定了客户端可能发送给服务器什么样的消息以及得到什么样的响应。请求和响应消息的头以ASCII形式给出;而消息内容则具有一个类似MIME的格式。这个简单模型是早期Web成功的有功之臣,因为它使开发和部署非常地直截了当。
SimpleAstronaut
2022/08/09
1.3K0
C++ CGIweb编程
拨打13116911968_缅甸九九贵宾会客服我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。
用户4492009
2019/12/29
9920
python爬虫(七)_urllib2:urlerror和httperror
urllib2的异常错误处理 在我们用urlopen或opener.open方法发出一个请求时,如果urlopen或opener.open不能处理这个response,就产生错误。 这里主要说的是URLError和HTTPError,以及对它们的错误处理。 URLError URLError产生的原因主要有: 没有网络连接 服务器链接失败 找不到指定的服务器 我们可以用try except语句来补货相应的异常。下面的例子里我们访问了一个不存在的域名。 #urllib2_urlerror.py impor
用户1174963
2018/01/17
2.4K0
相关推荐
⚡3分钟⚡熟悉面试常问状态码,面试官都听呆了
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验