터미널에서 API에 간단하게 질의할 때 보통 curl을 많이 사용했는데, 단순하게 결과만 나오는 부분에서 아쉬운 점이 있었다. 이번에 파이썬을 공부하다 보니 Django에서 공식페이지에서 HTTP로 커맨드 하는 부분이 있어 찾아보았다. Response 뿐만 아니라 헤더 정보와 http 상태도 같이 볼 수 있어 괜찮은 것 같다. 보통 윈도우나, 맥os 만 공식적으로 지원하는 부분이 많은데 리눅스까지 지원해 주는 부분도 인상적이다. 사용방법은 간단하다 설치하고 터미널에서 http로 질의하면 끝. 설치하기 맥os brew install httpie 윈도우 # Make sure we have an up-to-date version of pip and setuptools: pip install --upgrade ..
환경설정 1.1. 기본구성 pip >= 19.0.3 python >= 3.4 (django 2.2 지원 최소버전) # pip upgrade last version pip install --upgrade pip # check pip version pip --version pip 19.0.3 from /Users/.../pip-19.0.3-py3.7.egg/pip (python 3.7) 1.2. install django pip install django==2.2 pip install djangorestframework==3.11.0 $ django-admin startprject {project_name} $ ls {project_name}/ # django server start $ .manage.py ..
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.h..
https://www.phpliveregex.com/#tab-preg-match PHP Live Regex i case insensitive m treat as multi-line string s dot matches newline x ignore whitespace in regex A matches only at the start of string D matches only at the end of string U non-greedy matching by default www.phpliveregex.com
출처: https://gist.github.com/subfuzion/08c5d85437d5d4f00e58 Common Options `-#, --progress-bar` Make curl display a simple progress bar instead of the more informational standard meter. `-b, --cookie ` Supply cookie with request. If no `=`, then specifies the cookie file to use (see `-c`). `-c, --cookie-jar ` File to save response cookies to. `-d, --data ` Send specified data in POST request. Det..
1. mochahttp://mochajs.org 테스트 수트 : 테스트 환경을 모카에서는 describe()로 구현 테스트 케이스 : 실제 테스트 it() 으로 구현 //{filename}.spec.js : 테스트 코드 const assert = require('assert') describe('.js모듈의 함수', () => { it ('문자열을 대문자로 변환', () => { const result = {메소드}(value) assert.equal(result, 'ok') }) }) 2. shouldhttps://github.com/tj/should.js 1.mocha 에 비해 가독성이 좋다 describe('.js모듈의 함수', () => { it ('문자열을 대문자로 변환', () => { // ..
- Total
- Today
- Yesterday
- graphql-php
- 메일
- session+token authorize
- 둘이상인증한번에사용하기
- laravel-test
- 정의
- php-laravel
- graphql
- vim
- MySQL
- password-manager
- POP3
- php
- 정규식
- l5-swagger-response
- 테스트_다중트랜잭션
- 자바스크립트
- aaa패턴
- django
- addMonthWithoutOverflow
- Python
- 나는욕심쟁이
- l5-swagger
- bitwarden-cli
- exception-test
- composer-self-update
- Laravel
- 라라벨
- redis
- addMonth
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
29 | 30 |