티스토리 뷰
api.py
from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class HelloWorld(Resource):
def get(self):
return {'hello': 'world'}
api.add_resource(HelloWorld, '/')
if __name__ == '__main__':
app.run(debug=True)
실행하기
$ python api.py
* Running on http://127.0.0.1:5000/
* Restarting with reloader
#파이참 사용시 .html 사용으로 rest api test 할 수 있다.
# helloworld.htm
# get
GET localhost:5000/helloworld
출처 : https://jojoldu.tistory.com/266
IntelliJ의 .http를 사용해 Postman 대체하기
안녕하세요! 이번 시간엔 IntelliJ의 .http 파일을 어떻게 사용하는지 소개드리겠습니다. 모든 코드는 Github에 있습니다! 소개 프로젝트를 계속 운영하다보면 로컬 환경외에 개발/운영 환경에서 API �
jojoldu.tistory.com
출처 : https://flask-restful.readthedocs.io/en/latest/quickstart.html#a-minimal-api
Quickstart — Flask-RESTful 0.3.8 documentation
Quickstart It’s time to write your first REST API. This guide assumes you have a working understanding of Flask, and that you have already installed both Flask and Flask-RESTful. If not, then follow the steps in the Installation section. A Minimal API A
flask-restful.readthedocs.io
'공부합시다 > python' 카테고리의 다른 글
django 모델에서 datetime 한국시간으로 설정하기 (0) | 2020.08.11 |
---|---|
python 에서 oracle 사용하기 (0) | 2020.08.04 |
Python 패키지 의존성 관리 (0) | 2020.06.25 |
Django RESTframework (0) | 2020.06.25 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- addMonth
- php-laravel
- laravel-kafka
- django
- MySQL
- bitwarden-cli
- 자바스크립트
- 라라벨
- session+token authorize
- eloquent-observer
- password-manager
- 메일
- Laravel
- 테스트_다중트랜잭션
- redis
- graphql-php
- l5-swagger-response
- aaa패턴
- vim
- php
- observer 매개변수 전달하기
- Python
- 정규식
- addMonthWithoutOverflow
- graphql
- laravel-test
- l5-swagger
- exception-test
- 정의
- POP3
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함