Update API request structure in fastapi.http

- Replaced hardcoded URLs with a base URL variable for better configurability.
- Updated request payloads to use sessionId and timeStamp variables.
- Enhanced the chat request with new parameters: needFormUpdate and useTextChunk.
- Adjusted response content types and lengths for consistency.
- Updated timestamps in response headers for accuracy.
This commit is contained in:
Xin Wang
2026-06-18 10:45:33 +08:00
parent 83353c54d1
commit aa2768acc0

View File

@@ -1,75 +1,72 @@
@baseUrl = http://101.89.108.122:8000 @baseUrl = http://101.89.108.122:8000
@sessionId = a1103
@timeStamp = 202603310303
###
GET http://127.0.0.1:8080 GET {{baseUrl}}
HTTP/1.1 200 - OK HTTP/1.1 200 - OK
date: Wed, 17 Jun 2026 00:37:02 GMT date: Thu, 18 Jun 2026 02:37:30 GMT
server: uvicorn server: uvicorn
content-length: 32 content-length: 32
content-type: application/json content-type: application/json
connection: close connection: close
### ###
POST http://127.0.0.1:8080/chat POST {{baseUrl}}/chat?stream=true
content-type: application/json content-type: application/json
{ {
"sessionId": "a1100", "sessionId": "{{sessionId}}",
"timeStamp": "202503310303", "timeStamp": "{{timeStamp}}",
"text": "继续", "text": "两车追尾",
"needFormTags": true "needFormUpdate": true,
"useTextChunk": true
} }
HTTP/1.1 200 - OK HTTP/1.1 200 - OK
date: Wed, 17 Jun 2026 00:37:26 GMT date: Thu, 18 Jun 2026 02:40:12 GMT
server: uvicorn server: uvicorn
content-length: 274 content-type: text/event-stream; charset=utf-8
content-type: application/json
connection: close connection: close
transfer-encoding: chunked
### ###
POST http://127.0.0.1:8080/get_info POST {{baseUrl}}/get_info
content-type: application/json content-type: application/json
{ {
"sessionId": "a1002", "sessionId": "{{sessionId}}",
"timeStamp": "202503310303", "timeStamp": "{{timeStamp}}",
"key": "hphm1" "key": "hphm1"
} }
HTTP/1.1 200 - OK HTTP/1.1 200 - OK
date: Wed, 17 Jun 2026 00:27:12 GMT date: Thu, 18 Jun 2026 02:41:06 GMT
server: uvicorn server: uvicorn
content-length: 108 content-length: 97
content-type: application/json content-type: application/json
connection: close connection: close
### ###
POST http://127.0.0.1:8080/set_info POST {{baseUrl}}/set_info
content-type: application/json content-type: application/json
{ {
"sessionId": "a1002", "sessionId": "{{sessionId}}",
"timeStamp": "202503310303", "timeStamp": "{{timeStamp}}",
"key": "hphm1", "key": "hphm1",
"value": "沪A8939" "value": "沪A8939"
} }
HTTP/1.1 200 - OK
connection: close
content-length: 70
content-type: application/json
date: Thu, 08 Jan 2026 09:27:00 GMT
server: uvicorn
### ###
DELETE http://127.0.0.1:8080/delete_session DELETE {{baseUrl}}/delete_session
content-type: application/json content-type: application/json
{ {
"sessionId": "a1002", "sessionId": "{{sessionId}}",
"timeStamp": "202503310303" "timeStamp": "{{$timestamp}}"
} }
HTTP/1.1 200 - OK HTTP/1.1 200 - OK
connection: close date: Thu, 18 Jun 2026 02:37:48 GMT
content-length: 70 server: uvicorn
content-length: 71
content-type: application/json content-type: application/json
date: Thu, 08 Jan 2026 09:27:24 GMT connection: close
server: uvicorn