flask 백엔드로 활용하기 (3) get api from flask to spring

hyereen·2021년 7월 19일
1

flask-backend

목록 보기
3/7

env: flask, spring boot

spring 메인서버에서 파라미터에 key값으로 요청하면 json형식으로 데이터를 반환해준다.

@api.route('/motion/<string:word>', methods=['GET'])
class motion(Resource):
    def get(self, word):

        word = unquote_plus(word)
        combined = join_jamos(word)  

        return {'result' : "%s" % combined} 

파라미터로 ㅇㅏㄴㄴㅕㅇ을 넘기면 이를 안녕으로 반환해주었다.

그럼 spring에서는 json을 받아서 다시 클라이언트로 넘겨줄 수 있을 것이다.

profile
안녕하세요. 피드백은 언제나 감사합니다.

0개의 댓글