FLASK2 Flask의 make_response에서 TypeError: The view function did not return a valid response. The return type must be a string, dict, tuple, Response instance, or WSGI callable, but it was a list. from flask_marshmallow import Marshmallow ma = Marshmallow() class UserSchema(SQLAlchemyAutoSchema): class Meta: model = User users = [User(), User(), User(), ...] data = UserSchema().dump(users, many=True) res = make_response(data) File "C:\Users\...\flask\app.py", line 2127, in make_response raise TypeError( TypeError: The view function did not return a valid response. The return type must be .. 2021. 11. 3. java.net.ProtocolException: unexpected end of stream 미리 결론: 서버가 HTTP/1.0으로 응답해 발생했던 문제 1.1로 변경해서 해결됨. Retrofit 사용중에 간헐적으로 오류가 발생했다. 검색해보면 1. Connection: close 헤더를 추가하라거나 2. OkHttpClient.Builder에서 retryOnConnectionFailure를 true로 변경하라거나 3. 에뮬레이터에서만 발생하는 오류라거나 4. 그냥 OkHttp 자체의 버그이거나 5. 혹은 서버의 문제 라는 글들을 볼 수 있는데 1-3까지로는 해결되는게 없다. 4를 확인하기 위해 새 프로젝트를 만들어 UrlConnection을 사용해서 테스트를 했는데 같은 문제가 발생했다. 로그에서 OkHttp를 볼 수 있었어서 OkHttp 문제가 아니라는 것이 확인된 것은 아니지만, 프레임워크.. 2021. 5. 7. 이전 1 다음