![]() Using this method, the URL path would be returned from the origin server and you would receive a response similar to: HTTP/2.0 201 Created ![]() In other words, if a new forum thread is created and the thread path is not specified then you could use some like: POST /forums HTTP/2.0 A POST method should also be used if you do not know the specific URL of where your newly created resource should reside. For example, a POST method is used when a user comments on a forum or if they upload a profile picture. The HTTP POST method is used to send user-generated data to the web server. In short, the PUT method is used to create or overwrite a resource at a particular URL that is known by the client. Alternatively, a PUT method used to overwrite an existing resource could look like this: PUT /forums/ HTTP/2.0 Where would be the actual name or ID number of the thread. An example of a PUT method being used to create a new resource would resemble the following: PUT /forums/ HTTP/2.0 With this method, you can create a new resource or overwrite an existing one given you know the exact Request-URI. The PUT method completely replaces whatever currently exists at the target URL with something else. In this article, we're going to talk specifically about what the difference is between PUT vs POST as well as how to properly use each method. ![]() The two methods in question here are PUT and POST. Two of these methods are sometimes confused in regards to when each should be used. ![]() However, apart from GET, there are other types of HTTP methods including: For example, if you want to load an image from a particular website, your browser will make a request to the web server using the following command: GET The most popular HTTP method is the GET method which is used to retrieve data from a web server. ![]() There are various HTTP methods that exist and each one is used for different purposes. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |