Skip to content

Commit

Permalink
添加json支持
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolushuo committed Aug 16, 2023
1 parent 5a4a2c6 commit 22ab34d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build/123/0x7fbcf0d04f00.22.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"raw_request": "POST /messages/badge HTTP/1.1\r\nHost: 43.143.147.130:7788\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36\r\nContent-Length: 44\r\nAccept: application/json, text/plain, */*\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: zh-CN,zh;q=0.9\r\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryRAzNtNEA7I0iASwd\r\nCookie: edgesid=7s6YnkWytezVNzKoVRpNJm22hJQUw3Nv\r\nOrigin: http://43.143.147.130:7788\r\nReferer: http://43.143.147.130:7788/servers/create\r\nX-Requested-With: XMLHttpRequest\r\n\r\n------WebKitFormBoundaryRAzNtNEA7I0iASwd--\r\n",
"raw_response": "HTTP/1.1 200 OK\r\nContent-Security-Policy: default-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'\r\nContent-Type: application/json; charset=utf-8\r\nX-Frame-Options: SAMEORIGIN\r\nDate: Wed, 16 Aug 2023 07:58:04 GMT\r\nContent-Length: 64\r\n\r\n{\"code\":200,\"data\":{\"count\":0,\"teaMenu\":\"message\"},\"message\":\"\"}",
"request_domain": "43.143.147.130:7788",
"request_header": "Host: 43.143.147.130:7788\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36\r\nContent-Length: 44\r\nAccept: application/json, text/plain, */*\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: zh-CN,zh;q=0.9\r\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundaryRAzNtNEA7I0iASwd\r\nCookie: edgesid=7s6YnkWytezVNzKoVRpNJm22hJQUw3Nv\r\nOrigin: http://43.143.147.130:7788\r\nReferer: http://43.143.147.130:7788/servers/create\r\nX-Requested-With: XMLHttpRequest\r\n\r\n",
"request_method": "POST",
"request_postdata": "------WebKitFormBoundaryRAzNtNEA7I0iASwd--\r\n",
"request_url": "/messages/badge",
"response_body": "{\"code\":200,\"data\":{\"count\":0,\"teaMenu\":\"message\"},\"message\":\"\"}",
"response_header": "Content-Security-Policy: default-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'\r\nContent-Type: application/json; charset=utf-8\r\nX-Frame-Options: SAMEORIGIN\r\nDate: Wed, 16 Aug 2023 07:58:04 GMT\r\nContent-Length: 64\r\n\r\n",
"response_status_code": "200"
}
12 changes: 12 additions & 0 deletions build/123/0x7fbd9d204f00.2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"request_domain": "43.143.147.130:7788",
"request_header": "Host: 43.143.147.130:7788\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36\r\nContent-Length: 44\r\nAccept: application/json, text/plain, */*\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: zh-CN,zh;q=0.9\r\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary4lDEKqIjmVicQBKm\r\nCookie: edgesid=7s6YnkWytezVNzKoVRpNJm22hJQUw3Nv\r\nOrigin: http://43.143.147.130:7788\r\nReferer: http://43.143.147.130:7788/servers/create\r\nX-Requested-With: XMLHttpRequest\r\n\r\n",
"request_method": "POST",
"request_postdata": "------WebKitFormBoundary4lDEKqIjmVicQBKm--\r\n",
"raw_request": "POST /messages/badge HTTP/1.1\r\nHost: 43.143.147.130:7788\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36\r\nContent-Length: 44\r\nAccept: application/json, text/plain, */*\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: zh-CN,zh;q=0.9\r\nContent-Type: multipart/form-data; boundary=----WebKitFormBoundary4lDEKqIjmVicQBKm\r\nCookie: edgesid=7s6YnkWytezVNzKoVRpNJm22hJQUw3Nv\r\nOrigin: http://43.143.147.130:7788\r\nReferer: http://43.143.147.130:7788/servers/create\r\nX-Requested-With: XMLHttpRequest\r\n\r\n------WebKitFormBoundary4lDEKqIjmVicQBKm--\r\n",
"request_url": "/messages/badge",
"response_body": "{\"code\":200,\"data\":{\"count\":0,\"teaMenu\":\"message\"},\"message\":\"\"}",
"response_header": "Content-Security-Policy: default-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'\r\nContent-Type: application/json; charset=utf-8\r\nX-Frame-Options: SAMEORIGIN\r\nDate: Wed, 16 Aug 2023 06:59:51 GMT\r\nContent-Length: 64\r\n\r\n",
"response_status_code": "200"
}
再添加一个raw_response
12 changes: 12 additions & 0 deletions build/222/0x7fb5d1f04290.5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"raw_response": "HTTP/1.1 200 OK\r\nContent-Length: 2111\r\nContent-Type: text/html; charset=utf-8\r\nDate: Wed, 16 Aug 2023 07:06:41 GMT\r\nServer: gunicorn\r\nX-Cache: BYPASS\r\n\r\n<!DOCTYPE html>\n<html>\n<head>\n <title>商城系统 - 登录</title>\n <link rel=\"stylesheet\" href=\"/static/css/bootstrap.min.css\">\n</head>\n<body>\n <div class=\"container\">\n <h1 class=\"mt-5\">登录</h1>\n <form id=\"login-form\" class=\"mt-4\">\n <div class=\"form-group\">\n <label for=\"username\">用户名</label>\n <input type=\"text\" class=\"form-control\" id=\"username\" placeholder=\"请输入用户名\">\n </div>\n <div class=\"form-group\">\n <label for=\"password\">密码</label>\n <input type=\"password\" class=\"form-control\" id=\"password\" placeholder=\"请输入密码\">\n </div>\n <button type=\"submit\" class=\"btn btn-primary\">登录</button> \n <p id=\"message\" class=\"mt-3\"></p>\n </form>\n <button class=\"btn btn-primary\" onclick=\"window.location.href='/register'\">去注册</button>\n \n </div>\n\n <script src=\"/static/js/jquery-3.6.0.min.js\"></script>\n <script>\n $('#login-form').submit(function(event) {\n event.preventDefault();\n\n var username = $('#username').val();\n var password = $('#password').val();\n\n // 判断用户名和密码是否为空\n if (!username || !password) {\n $('#message').text('用户名和密码不能为空');\n return;\n }\n\n $.ajax({\n url: '/api/login',\n type: 'POST',\n contentType: 'application/json',\n data: JSON.stringify({ 'username': username, 'password': password }),\n success: function(response) {\n $('#message').text(response.message);\n if (response.message === '登录成功') {\n alert('登录成功');\n window.location.href = '/dashboard';\n }\n },\n error: function(error) {\n $('#message').text(error);\n }\n });\n });\n </script>\n</body>\n</html>",
"request_domain": "demo.1314mylove.com",
"request_header": "Host: demo.1314mylove.com\r\nUser-Agent: curl/7.88.1\r\nAccept: */*\r\n\r\n",
"request_method": "GET",
"request_postdata": "",
"request_raw_request": "GET / HTTP/1.1\r\nHost: demo.1314mylove.com\r\nUser-Agent: curl/7.88.1\r\nAccept: */*\r\n\r\n",
"request_url": "/",
"response_body": "<!DOCTYPE html>\n<html>\n<head>\n <title>商城系统 - 登录</title>\n <link rel=\"stylesheet\" href=\"/static/css/bootstrap.min.css\">\n</head>\n<body>\n <div class=\"container\">\n <h1 class=\"mt-5\">登录</h1>\n <form id=\"login-form\" class=\"mt-4\">\n <div class=\"form-group\">\n <label for=\"username\">用户名</label>\n <input type=\"text\" class=\"form-control\" id=\"username\" placeholder=\"请输入用户名\">\n </div>\n <div class=\"form-group\">\n <label for=\"password\">密码</label>\n <input type=\"password\" class=\"form-control\" id=\"password\" placeholder=\"请输入密码\">\n </div>\n <button type=\"submit\" class=\"btn btn-primary\">登录</button> \n <p id=\"message\" class=\"mt-3\"></p>\n </form>\n <button class=\"btn btn-primary\" onclick=\"window.location.href='/register'\">去注册</button>\n \n </div>\n\n <script src=\"/static/js/jquery-3.6.0.min.js\"></script>\n <script>\n $('#login-form').submit(function(event) {\n event.preventDefault();\n\n var username = $('#username').val();\n var password = $('#password').val();\n\n // 判断用户名和密码是否为空\n if (!username || !password) {\n $('#message').text('用户名和密码不能为空');\n return;\n }\n\n $.ajax({\n url: '/api/login',\n type: 'POST',\n contentType: 'application/json',\n data: JSON.stringify({ 'username': username, 'password': password }),\n success: function(response) {\n $('#message').text(response.message);\n if (response.message === '登录成功') {\n alert('登录成功');\n window.location.href = '/dashboard';\n }\n },\n error: function(error) {\n $('#message').text(error);\n }\n });\n });\n </script>\n</body>\n</html>",
"response_header": "Content-Length: 2111\r\nContent-Type: text/html; charset=utf-8\r\nDate: Wed, 16 Aug 2023 07:06:41 GMT\r\nServer: gunicorn\r\nX-Cache: BYPASS\r\n\r\n",
"response_status_code": "200"
}
12 changes: 12 additions & 0 deletions build/222/0x7fb5d3204a70.2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"raw_response": "HTTP/1.1 200 OK\r\nContent-Length: 144\r\nContent-Type: application/json\r\nDate: Wed, 16 Aug 2023 07:06:38 GMT\r\nServer: gunicorn\r\nX-Cache: BYPASS\r\nConnection: close\r\n\r\n{\n \"code\": 500,\n \"message\": \"\\u7528\\u6237\\u540d\\u6216\\u5bc6\\u7801\\u4e0d\\u6b63\\u786e\",\n \"status\": \"error\",\n \"timestamp\": 16921695985398.85\n}\n",
"request_domain": "demo.1314mylove.com",
"request_header": "Host: demo.1314mylove.com\r\nContent-Length: 43\r\nAccept: */*\r\nX-Requested-With: XMLHttpRequest\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203\r\nContent-Type: application/json\r\nOrigin: http://demo.1314mylove.com\r\nReferer: http://demo.1314mylove.com/\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,zh-TW;q=0.5\r\nConnection: close\r\n\r\n",
"request_method": "POST",
"request_postdata": "{\"username\":\"test123\",\"password\":\"test123\"}",
"request_raw_request": "POST /api/login HTTP/1.1\r\nHost: demo.1314mylove.com\r\nContent-Length: 43\r\nAccept: */*\r\nX-Requested-With: XMLHttpRequest\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203\r\nContent-Type: application/json\r\nOrigin: http://demo.1314mylove.com\r\nReferer: http://demo.1314mylove.com/\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,zh-TW;q=0.5\r\nConnection: close\r\n\r\n{\"username\":\"test123\",\"password\":\"test123\"}",
"request_url": "/api/login",
"response_body": "{\n \"code\": 500,\n \"message\": \"\\u7528\\u6237\\u540d\\u6216\\u5bc6\\u7801\\u4e0d\\u6b63\\u786e\",\n \"status\": \"error\",\n \"timestamp\": 16921695985398.85\n}\n",
"response_header": "Content-Length: 144\r\nContent-Type: application/json\r\nDate: Wed, 16 Aug 2023 07:06:38 GMT\r\nServer: gunicorn\r\nX-Cache: BYPASS\r\nConnection: close\r\n\r\n",
"response_status_code": "200"
}

0 comments on commit 22ab34d

Please sign in to comment.