- Building RESTful Web Services with PHP 7
- Haafiz Waheed ud din Ahmad
- 74字
- 2021-07-03 00:02:21
Updating a comment
- Request: PATCH /comment/1?comment="Modified%20Awesome%20Comment' HTTP/1.1
- Response:
{id:1, post_id:1, comment:"Modified Awesome Comment", link: "/comments/1"}
- Response code: 200 OK
Here, we used PATCH as we want to update a single attribute of a comment that is a comment. Also, you can see %20 passed in a new comment. So, %20 is just a replacement for a space as a URL cannot contain spaces. So with URL encoding, spaces should always be replaced by %20.
推薦閱讀
- Oracle從入門(mén)到精通(第3版)
- The Complete Rust Programming Reference Guide
- VMware View Security Essentials
- OpenCV實(shí)例精解
- MongoDB for Java Developers
- 從程序員到架構(gòu)師:大數(shù)據(jù)量、緩存、高并發(fā)、微服務(wù)、多團(tuán)隊(duì)協(xié)同等核心場(chǎng)景實(shí)戰(zhàn)
- GitLab Repository Management
- Python Network Programming Cookbook(Second Edition)
- Java Web開(kāi)發(fā)技術(shù)教程
- Vue.js 2 Web Development Projects
- 深入實(shí)踐Kotlin元編程
- Hadoop 2.X HDFS源碼剖析
- UX Design for Mobile
- Java程序設(shè)計(jì)教程
- JavaScript前端開(kāi)發(fā)基礎(chǔ)教程