티스토리 뷰
728x90
#!/bin/bash
for ARG in "$@"
do
K=$(echo "${ARG}" | cut -f1 -d=)
V=$(echo "${ARG}" | cut -f2 -d=)
case "${K}" in
ENV) ENV=${V} ;;
VERSION) VERSION=${V} ;;
FILE) FILE=${V} ;;
VALUE) VALUE=${V} ;;
esac
done
case "${ENV}" in
stage) path=https://satage/asdf ;;
production) path=https://production/asdf ;;
esac
if [ -z "${VERSION}" ]; then
VERSION=v1
fi
path="${path}/${VERSION}"
echo "======================================================="
HEADER="Content-Type: application/json"
if [ ! -z "${FILE}" ]; then
curl \
-H "${HEADER}" \
-X PUT "${path}" \
-d @"${FILE}"
elif [ ! -z "${VALUE}" ]; then
curl \
-H "${HEADER}" \
-X PUT "${path}" \
-d "${VALUE}"
else
curl \
-H "${HEADER}" \
-X GET "${path}"
fi
https://stackoverflow.com/questions/13782198/how-to-do-a-put-request-with-curl
How to do a PUT request with cURL?
How do I test a RESTful PUT (or DELETE) method using cURL?
stackoverflow.com
https://stackoverflow.com/questions/34847981/curl-with-multiline-of-json
Curl with multiline of JSON
Consider the curl command below, is it possible to allow newline in JSON (without the minify) and execute directly in bash (Mac/Ubuntu) curl -0 -v -X POST http://www.example.com/api/users \ -H "Ex...
stackoverflow.com
728x90
'공부' 카테고리의 다른 글
[kotlin] list to map (0) | 2022.07.09 |
---|---|
[MySQL] user (0) | 2022.07.09 |
[kotlin] forEach break(return@forEach) & continue(return@run) (0) | 2022.07.09 |
[kotlin] testcase suspend fun (+ assertThrows) (0) | 2022.07.09 |
[linux] pushd, popd (0) | 2022.07.09 |
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 테슬라 리퍼럴 코드 생성
- 테슬라 레퍼럴
- 개리마커스
- 테슬라 추천
- Bot
- 팔로워 수 세기
- 테슬라 레퍼럴 코드 확인
- 모델 Y 레퍼럴
- 모델y
- 레퍼럴
- 유투브
- 김달
- 연애학개론
- COUNT
- 어떻게 능력을 보여줄 것인가?
- 할인
- 메디파크 내과 전문의 의학박사 김영수
- Kluge
- 테슬라 크레딧 사용
- 테슬라 레퍼럴 적용 확인
- 인스타그램
- 테슬라 리퍼럴 코드
- 테슬라 리퍼럴 코드 혜택
- 책그림
- 테슬라
- 클루지
- follower
- wlw
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함