File D:\ProgramData\miniconda3\Lib\site-packages\requests\api.py:59, in request(method, url, kwargs)
55 # By using the 'with' statement we are sure the session is closed, thus we
56 # avoid leaving sockets open which can trigger a ResourceWarning in some
57 # cases, and look like a memory leak in others.
58 with sessions.Session() as session:
---> 59 return session.request(method=method, url=url, kwargs)
File D:\ProgramData\miniconda3\Lib\site-packages\requests\sessions.py:697, in Session.send(self, request, **kwargs)
694 hooks = request.hooks
696 # Get the appropriate adapter to use
--> 697 adapter = self.get_adapter(url=request.url)
699 # Start time (approximately) of the request
700 start = preferred_clock()
File D:\ProgramData\miniconda3\Lib\site-packages\requests\sessions.py:792, in Session.get_adapter(self, url)
789 return adapter
791 # Nothing matches :-/
--> 792 raise InvalidSchema(f"No connection adapters were found for {url!r}")
InvalidSchema: No connection adapters were found for 'localhost:9001/api/user'
版本信息:
win10
mysql: 8
powershell: 7.4
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:03:56) [MSC v.1929 64 bit (AMD64)]
requests 2.32.3
pnpm运行成功: 数据库导入成功: 数据库示例: env: python请求: python报错信息:
InvalidSchema Traceback (most recent call last) Cell In[2], line 8 5 payload = "{\r\n \"name\": \"admin\",\r\n \"password\": \"admin\",\r\n \"cellphone\": 13680666666,\r\n \"introduce\": null,\r\n \"avatar_url\": null\r\n}" 6 headers = {} ----> 8 response = requests.request("POST", url, headers=headers, data=payload) 10 print(response.text)
File D:\ProgramData\miniconda3\Lib\site-packages\requests\api.py:59, in request(method, url, kwargs) 55 # By using the 'with' statement we are sure the session is closed, thus we 56 # avoid leaving sockets open which can trigger a ResourceWarning in some 57 # cases, and look like a memory leak in others. 58 with sessions.Session() as session: ---> 59 return session.request(method=method, url=url, kwargs)
File D:\ProgramData\miniconda3\Lib\site-packages\requests\sessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) 584 send_kwargs = { 585 "timeout": timeout, 586 "allow_redirects": allow_redirects, 587 } 588 send_kwargs.update(settings) --> 589 resp = self.send(prep, **send_kwargs) 591 return resp
File D:\ProgramData\miniconda3\Lib\site-packages\requests\sessions.py:697, in Session.send(self, request, **kwargs) 694 hooks = request.hooks 696 # Get the appropriate adapter to use --> 697 adapter = self.get_adapter(url=request.url) 699 # Start time (approximately) of the request 700 start = preferred_clock()
File D:\ProgramData\miniconda3\Lib\site-packages\requests\sessions.py:792, in Session.get_adapter(self, url) 789 return adapter 791 # Nothing matches :-/ --> 792 raise InvalidSchema(f"No connection adapters were found for {url!r}") InvalidSchema: No connection adapters were found for 'localhost:9001/api/user'
版本信息: win10 mysql: 8 powershell: 7.4 Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:03:56) [MSC v.1929 64 bit (AMD64)] requests 2.32.3
补充说明: 没有前后端经验,请问这个是什么问题,需要怎么解决,怎么排查?