3_5_4.py asyncio 에서 response.status_code 실행 문제
327
작성한 질문수 34
안녕하세요 강사님,
앞서 synchronous, threading, multiprocessing 에서는
print(f'[Read Contents : {len(response.content)}, Status Code : {response.status_code} from {url}]') 잘 실행이 되어, status code: 200 값을 확인 할 수 있었습니다.
그런데 asyncio에서는 response.status_code가 출력이 안됩니다.
강사님 설명처럼, 그냥 response 값 전체를 출력하면 확인할 수 있지만.. asyncio에서는 왜 response.status_code 가 실행이 안되는지 설명 좀 부탁 드리겠습니다.
답변 1
0
아래 예제를 참고하세요.
후에 aiohttp를 사용하셔서 출력하시면 됩니다.
의도한대로 출력이 되지 않을 떄는 항상 공식 레퍼런스에서 메소드를 제공하는지 찾아보시길 바래요.
https://stackoverflow.com/questions/46445019/aiohttp-when-is-the-response-status-available
resp object is available inside async with block. Therefore resp.status is available too. Also you can call await on some methods, like resp.text() but is doesn't release control of async with block. You can work with resp even after await has been called.
Pros and Cons 관련하여 질문드립니다
0
59
1
daemon=True가 안 먹히네요
0
86
2
threadpoolexecutor.submit 실행 시 순차 실행
0
213
2
queue 를 사용하는 이유?
1
227
1
멀티프로세싱 관련 질문
0
178
1
python gil 삭제
0
369
1
4분:59초 질문 그룹쓰레드 (5). 대기중인 작업 -> Queue -> 완료 상태조사 -> 결과 또는 예외 -> 단일화(캡슐화) 에 관해서
0
166
1
데몬스레드 설명
0
238
1
작업영역 질문
0
303
1
cmd에서 code작성시 기존에 깔아둔 vscode에서 이상한 화면이 뜨네요
0
286
1
ThreadPoolExecutor에서 작업중인 쓰레드가 있을때 대기할수 있는 방법이 있는지요?
0
278
1
py_ad_2_5_2 Sharing State의 Argument 부분
0
298
1
Thread(4) 16:10 스레드 질문
0
338
1
파이썬 병렬처리 관련 질문이 있습니다.
0
348
1
10:10쯤에 질문있습니다.
0
253
1
multiprocessing(5) - Queue 공유 질문 in multiprocess
0
431
1
seleniumwire multiprocessing 에러
0
725
1
logging과 print 차이 질문입니다..!
0
658
1
확장프로그램 질문입니다
0
294
1
KeyboardInterrupt 시 p.join에서 exception 발생
0
415
1
경쟁상태,교착상태, 메모리영역
0
258
1
ProcessPoolExecutor 사용 시 pid 증가
0
354
1
multiprocess 환경에서 특정 Process에 문제가 있거나 죽었을때 처리 방법
0
751
1
ThreadPoolExecutor 에서 max_workers 질문입니다.
2
1525
1





