Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用GCDWebServer,当method为GET时,NSLog request.query是我传递的参数字典,就是我想要的。但是什么时候是 POST,request.query 是 nil 呢?为什么?谢谢
该query属性仅适用于 URL 中的查询,不适用于 POST 正文中的查询。
query
对于典型的 POST 表单,您将需要使用GCDWebServerURLEncodedFormRequest类和arguments属性来访问数据。
GCDWebServerURLEncodedFormRequest
arguments
有关示例,请参阅 README,有关更多信息,请参阅标题。