delete multiple items jihoon - GANGNAM-JAVA/JAVA-STUDY GitHub Wiki
-
https://stackoverflow.com/a/21863914
- record ํ๋๋น ํ๋์ request
- RESTfulํ ๋ฐฉ๋ฒ์ด๊ธฐ๋ ํ๋, ์ ์ฝ์ด ๋ฐ๋ฅธ๋ค.
- URL param์ ํตํด id๋ฅผ ์ฌ๋ฌ ๊ฐ ์ ๋ฌ (E.g> "/records/1;2;3)
- ํ์ง๋ง๋ผ. ์ค๊ฐ์(proxy์ ๊ฐ์) ์
์ฅ์์๋ /records/1;2;3;์ด๋ผ๋ single record๋ฅผ ์ญ์ ํ๋ค๋ ์๋ฏธ๋ก ํด์ํ๋ค.
๊ทธ๋์, /records/1, /records/2, /records/3 ์ด ์๋ /records/1;2;3;์ ์บ์๋ฅผ ๋ฌดํจํํ๋ค. ์์ฒญํ ๋ฐ์ดํฐ๊ฐ ์๊ตฌ์ ์ผ๋ก ์ญ์ ๋์์์ ์๋ฏธํ๋ ์ํ ์ฝ๋์ธ 410๋ฅผ /records/1;2;3;์ ๋ํด ํ๋ก์๊ฐ ๋ด๋ ค์ค ์ ์์ง๋ง, ๊ฐ๊ฐ์ ๋ํด์๋ ๊ทธ๋ฌ์ง ๋ชปํ๋ค.
- ํ์ง๋ง๋ผ. ์ค๊ฐ์(proxy์ ๊ฐ์) ์
์ฅ์์๋ /records/1;2;3;์ด๋ผ๋ single record๋ฅผ ์ญ์ ํ๋ค๋ ์๋ฏธ๋ก ํด์ํ๋ค.
- non-REST ๋ฐฉ์์ผ๋ก, ์ญ์ ํ item์ id๋ค์ ํฌํจํ๋ JSON์ ์ ๋ฌ
- best ๋ฐฉ๋ฒ, RESTfullํ๊ฒ ํ ์ ์๋ค.
- ์ฒซ ๋ฒ์งธ ๋ฐฉ๋ฒ
- 'change request' resource๋ฅผ ์์ฑ(E.g> records=[1,2,3]์ body์ ๋ด์ /delete-requets๋ก POST ์์ฒญ)ํ๋ ๋ฉ์๋๋ฅผ ๋ง๋ค๊ณ , ํด๋น request๊ฐ accepted ๋๋์ง, reject(๊ฑฐ๋ถ) ๋๋์ง, in progress(์งํ์ค) ์ธ์ง, competed(์๋ฃ) ๋๋์ง polling์ ํตํด ํ์ธํ๋ค.
- ์ค๋ ๊ฑธ๋ฆฌ๋ operation์ ์ ์ฉํ๋ค.
- ๋ ๋ฒ์งธ ๋ฐฉ๋ฒ
- body์ ์ญ์ ํ ๋ฆฌ์์ค ๋ฆฌ์คํธ์ ์ํํ ์ก์ ์ ํฌํจ(format์ ์์ ๋กญ๊ฒ)ํ์ฌ /records์ PATCH ์์ฒญ
- ์งง๊ฒ ๊ฑธ๋ฆฌ๋ operation์ ์ ์ฉ
- record ํ๋๋น ํ๋์ request
-
https://stackoverflow.com/a/50979689
-
Mozilla Storage Service SyncStorage API v1.5
- BSO๋ basic storage object๋ก, ํด๋น ์๋น์ค์ storage ๋จ์๋ก ๋ณด์
- collections ์ ๋ถ๋ฅผ ์ญ์ ํ ๊ฒฝ์ฐ
DELETE https://<endpoint-url>/storage/<collection>
- single item ์ญ์ ํ ๊ฒฝ์ฐ
DELETE https://<endpoint-url>/storage/<collection>/<id>
- multiple items ์ญ์ ํ ๊ฒฝ์ฐ
DELETE https://<endpoint-url>/storage/<collection>?ids=<ids>
- Question
- /collection/ids=1,2,3์ผ๋ก ์์ฒญํ๋๋ฐ, 3์ด ์ด๋ฏธ ์กด์ฌํ์ง ์๋ ๊ฒฝ์ฐ ์ํ ์ฝ๋๋ฅผ ์ด๋ป๊ฒ ๋ด๋ ค์ค์ผ ํ ๊น?
-
-
https://www.cikorea.net/bbs/view/etc_qna?idx=20840&lists_style=
- RESTful์ ์ ์ ์๊ณ ๊ทธ๋ฅ ์๋ก์ด ๋ผ์ฐํธ๋ฅผ ์ ์
HTTP PATCH /board/drop?id=1,2,3,4,5,10
TRACE ๋ฉ์๋๊ฐ ๋ฌธ์ ๊ฐ ๋๋ ์ด์ ๋ "XST(Cross-Site Tracing)" ๋๋ฌธ์ด๋ค.
๊ณต๊ฒฉ์๊ฐ ํด๋ผ์ด์ธํธ๊ฐ TRACE ์์ฒญ์ ํ๋๋ก ํ์ฌ, ๊ทธ response๋ฅผ ํตํด Basic ์ธ์ฆ์ ํจ์ค์๋๋ฅผ ํ๋ํ๋๋ฐ ์ฌ์ฉ๋๋ ๊ณต๊ฒฉ์ด๋ค.
์ด๋ฐ ์ด์ ๋ก TRACE ๋ฉ์๋๋ฅผ ๋ฌดํจ๋ก ํ ๊ฒ์ ๊ถ์ฅํ๊ณ ์๋ค.
tomcat ๋ฑ์ container๋ nginx ๋ฑ์ web server๋ ๊ธฐ๋ณธ์ ์ผ๋ก TRACE ๋ฉ์๋๋ not allowed ๋์ด ์๋ค. 405(ํ์ฉ๋์ง ์๋ ๋ฐฉ๋ฒ)๋ฅผ ๋ด๋ ค์ค๋ค.
https://tomcat.apache.org/tomcat-8.5-doc/config/http.html