gpt4 book ai didi

http - http get请求中的多个参数

转载 作者:可可西里 更新时间:2023-11-01 15:15:43 28 4
gpt4 key购买 nike

是形式为 http://asdf.com/something.do?param1=true?param2=false 的网址有效吗?

我不认为第二个?在有效的 url 中是允许的,它应该是一个符号 (&),但我无法在 http 1.1 rfc 中找到任何关于这个的信息。有什么想法吗?

最佳答案

使用无效?再次。 ?应指示参数列表的开始。 & 应该分隔参数。

来自 RFC 3986 :

URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

来自 RFC 1738 :

An HTTP URL takes the form:

http:// <host> : <port> / <path> ? <searchpart>

where <host> and <port> are as described in Section 3.1. If :<port> is omitted, the port defaults to 80. No user name or password is allowed. <path> is an HTTP selector, and <searchpart> is a query string. The <path> is optional, as is the <searchpart> and its preceding "?". If neither <path> nor <searchpart> is present, the "/" may also be omitted.

Within the <path> and <searchpart> components, "/", ";", "?" are reserved. The "/" character may be used within HTTP to designate a hierarchical structure.

search part/query part is described here .

关于http - http get请求中的多个参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/612259/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com