Problem situation
-
.net core로 api 제작 후 디버그(iis express 선택) 하면 브라우져로 접속이 확인 되는데 android emulator로 flutter 앱에서 api get 을 날리면 결과값이 없고 400 error
check points
-
flutter에서 HttpClient로 접근하는 Url을 내부(localhost)로 지정 -> 400 에러 뜸
-
Url을 ipconfig로 반환받은 ipV4로 변경해봄 -> 400 에러 뜸
-
android emulator에서는 local이(동일 컴퓨터 작업 시 서버 띄운 컴을 local로 생각함) 10.0.2.2라고 해서 변경해봄 -> 400 에러 뜸
-
flutter에서 launchsetting.json에 표시된 port들 차례로 시도. -> 400 에러 뜸

2. ip변경으로 안되서 방화벽 인바운드 설정.
사진 url 3개 중에 iis express로 디버깅 했을 때 브라우져 표시된 포트는 '44368' -> '44368' 인바운드 설정해줌. -> 400 에러 뜸
Solution
-
IIS 서버 설정(설치) 후 .net api 플젝 배포 후 웹사이트로 추가
-
IIS 서버 설치 후 디버그로도 시도해보려 했으나 실패. (빌드 후 runtime 에러 '사이트 찾을 수 없음')
-

Find Out
-
iis express 로 올라간 웹은 'localhost'로만 접근 가능 -> android emulator는 동일 네트워크여도 엄연히 다른 기기. local로 접근 불가. (참고 : www.quora.com/Why-should-I-develop-using-full-IIS-rather-than-IIS-Express)
Why should I develop using full IIS rather than IIS Express?
Answer (1 of 3): I’m in your camp. All the development work I have done in Visual Studio (2008, 2010, 2013, 2015) I have always used IIS Express for testing. And with each and every project I’ve never encountered any issues with publishing my applicati
www.quora.com
'Developer_Note > BackEnd' 카테고리의 다른 글
Http 405 Error 원인이 IIS Dav? (0) | 2020.10.12 |
---|