-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't GET or POST request for custom ports with URL #1528
Labels
Comments
i am not sure it is aiohttp problem, seems your |
@fafhrd91 no, it open normally in browser and |
i did quick test: test_1528.py: #!/usr/bin/env python3
import asyncio
from aiohttp.web import Application, Response, HTTPOk, run_app
async def index(request):
return Response(status=200, text='test')
async def init(loop):
app = Application()
app.router.add_get('/', index)
return app
loop = asyncio.get_event_loop()
app = loop.run_until_complete(init(loop))
run_app(app, port=410) test_1528_2.py: #!/usr/bin/env python3
import asyncio
import aiohttp
from aiohttp.web import Application, Response, HTTPOk, run_app
async def index(request):
async with aiohttp.ClientSession() as session:
async with session.get('http://127.0.0.1:410/') as resp:
print(resp.status)
print(await resp.text())
return Response(status=200, text='test')
async def init(loop):
app = Application()
app.router.add_get('/', index)
return app
loop = asyncio.get_event_loop()
app = loop.run_until_complete(init(loop))
run_app(app, port=8080) got:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I use server to recieve some requests and then generate new ones and send it on another local server with custom port 410, but when I make
async with session.get('http://127.0.0.1:410/someurl') as resp:
(someurl
for example here) I get error:But at that time I can request to
http://127.0.0.1:410/
and normally get content.Example code:
I coding on Windows 10, Python ver. 3.6.0
The text was updated successfully, but these errors were encountered: