diff --git a/.github/postError.gif b/.github/postError.gif index c1ee0a3..78595f2 100644 Binary files a/.github/postError.gif and b/.github/postError.gif differ diff --git a/README.md b/README.md index 685e581..24ab019 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@

Pokebook

- A social media for pokemons based in the HTTP protocol + A social media website for pokemons based on the HTTP protocol

@@ -53,7 +53,10 @@
  • - Errors + Status Codes +
  • +
  • + Authors
  • @@ -61,17 +64,17 @@ ## 💻 About The Project -In this project, an HTTP/1.1 server were implemented, capable of interpreting some HTTP protocol commands received through requests from browsers, and respond appropriately to those requests. +In this project, we implemented a HTTP/1.1 server capable of interpreting a few HTTP requests from browsers and respond appropriately to these requests. -The commands implemented were: GET, PUT, POST and DELETE. +The request methods implemented were: GET, PUT, POST and DELETE. -The HTTP server were implemented according to [RFC 2616](https://tools.ietf.org/html/rfc2616), which defines the HTTP/1.1 protocol. +The HTTP server was implemented according to the [RFC 2616](https://tools.ietf.org/html/rfc2616), which defines the HTTP/1.1 protocol. ![app](https://github.com/WebisD/http-api-without-lib/blob/master/.github/app.gif) ## 📖 Documentation -You can read the documentation here: +You can read the code documentation here: a @@ -111,7 +114,7 @@ In your browser, go to `http://localhost:8083` and click in `Add new friends` Then, fill in the fields and clik in `Add` -> This will send a post method to the server that will handle that data, store it in the databse and return a message +> This will send a POST request to the server which will handle the data, store it in the databse and return the outcome of the operation > The image is received by the server as data-uri that downloads the image and stores it locally @@ -120,11 +123,11 @@ Then, fill in the fields and clik in `Add` ### 🔀 PUT In your browser, go to `http://localhost:8083` and click in `See your friends` -Choose a friend you want to edit the information and click `Edit` +Choose the friend you want to edit the information of and click `Edit` Fill in the fields and clik in `Save Changes` -> This will send a POST method to the server requesting the replacement of the information +> This will send a PUT request to the server requesting the replacement of the information > > If it's an image, the server will delete the last image and replace with the new one @@ -133,29 +136,71 @@ Fill in the fields and clik in `Save Changes` ### 🗑️ DELETE In your browser, go to `http://localhost:8083` and click in `See your friends` -* Delete one +* Delete one friend -Choose a friend you want to delete the information and click `Delete` + Choose a friend you want to delete the information of and click `Delete` -* Delete all +* Delete all friends -Choose a friend you want to delete the information and click `Delete All` + If you want to delete all of your friends' information click `Delete All` -> In both cases, the button will send a DELETE method to the server that will delete the image and the info related with that friend +> In both cases, the button will send a DELETE request to the server that will delete the image and the info related with that friend ![delete](https://github.com/WebisD/http-api-without-lib/blob/master/.github/delete.gif) -## ❌ Errors +## 📜 Status Code + In most cases, the server will return status codes on your browser console (which you can see by pressing `F12`) saying whether the operation was successful or not -Here are the most common Error codes and how you can see them +Here are the most common status codes and how you can see them + +### Successful 2xx + +* #### 200 OK 👍 + + This is the state that you will see the most, whenever a GET is successful this status code will be shown + +* #### 201 Created 🆕 + + This status will occur when you click `Add` to add a new friend on the `Add new friend`'s page + +### Redirection 3xx + +* #### 301 Moved Permanently 👉 + + For this state to occur it is a little more complicated. Go to our server and access this directory `./databaseUser/Images` + + Now, feel free to move some of the images around (just don't take it out of the main folder of this project) + + If you try a GET or click on `list all friends`, you can see this status code and the new image path on the terminal + + ![moved](https://github.com/WebisD/http-api-without-lib/blob/master/.github/moved.gif) + +### Client Error 4xx + +* #### 400 Bad Request 👎 + If the fields to register a friend are not completely filled out, an error will occur and will be shown in the browser (as in the following gif) and in the terminal + + ![badpost](https://github.com/WebisD/http-api-without-lib/blob/master/.github/postError.gif) + +* #### 404 Not Found :man_shrugging: + If the requested page does not exist, an error will occur and will be shown in the browser + + On this page, you can play the famous google dinosaur game or go back to the main page + + ![erro](https://github.com/WebisD/http-api-without-lib/blob/master/.github/erro.gif) -### 404 Not Found -If the requested page does not exist, an error will occur and will be shown in the browser +### Server Error 5xx -On this page, you can play the famous google dinosaur game or go back to the main page +* #### 500 Internal Server Error -![erro](https://github.com/WebisD/http-api-without-lib/blob/master/.github/erro.gif) + In case you see this, something happened to our server and we will resolve it soon + +## 🤖 Authors +[Antonio Gustavo](https://github.com/antuniooh) | [João Vitor Dias](https://github.com/JoaoDias-223) | [Weverson da Silva](https://github.com/WebisD) +:-------------------------:|:-------------------------:|:-------------------------: +drawing | drawing| drawing +22.1190001-0 | 22.119.006-9 | 22.119.004-4 pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy