Skip to content

Commit

Permalink
update chatConversation to POST and README
Browse files Browse the repository at this point in the history
  • Loading branch information
LangHuiHE committed Nov 13, 2021
1 parent be1f5aa commit c3ec913
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ APIs list:

## Users related API
need login first
- deleteUser (method delete)
- deleteUser (DELETE method)
* localhost:8080/users
* send URL encoded utf-8
* userID : (userID)

---

- updateUserName (method PUT)
- updateUserName (PUT method)
* localhost:8080/users
* send: URL encoded utf-8
* userID : (userID)
Expand All @@ -56,7 +56,7 @@ need login first

---

- updateUserPassword (method PUT)
- updateUserPassword (PUT method)
* localhost:8080/users
* send: URL encoded utf-8
* userID : (userID)
Expand All @@ -66,7 +66,7 @@ need login first

---

- auth ( method POST)
- auth (POST method)
* localhost:8080/sessions
* send: URL encoded utf-8
* userName : (name)
Expand All @@ -79,7 +79,7 @@ need login first

---

- createUser ( method POST)
- createUser (POST method)
* localhost:8080/users
* send URL encoded utf-8
* userName : (name)
Expand All @@ -100,14 +100,14 @@ need login first
## Chat related API

- getChatHistory (GET method)
* localhost:8080/chat
* localhost:8080/history
* send with URL encoded utf-8
* userID : (userID)
* resp: 400(userID can't covert to int or bad or can't find it) 204 (OK but not history found)

----

- chatConversation (POST method)
- chatConversation (GET method)
* localhost:8080/chat
* send with URL encoded utf-8
* userID : (userID)
Expand Down
6 changes: 3 additions & 3 deletions Server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,10 @@ def do_GET(self):

if collection == "users":
self.getUserS()
elif collection == "chat":
elif collection == "history":
self.getChatHistory()
elif self.path == "/chat":
self.chatConversation()
elif self.path == "/logout":
self.logOut()
else:
Expand All @@ -472,8 +474,6 @@ def do_POST(self):
self.handleAuthenticateUser()
elif self.path == "/users":
self.createUser()
elif self.path == "/chat":
self.chatConversation()

else:
print("do_POST not found")
Expand Down

0 comments on commit c3ec913

Please sign in to comment.