더북(TheBook)

D.2.3 –X 옵션을 이용한 메서드 지정

-X 옵션을 이용하면 POST, GET, PUT, DELETE 같은 메서드를 지정할 수 있습니다. GETDELETE 메서드는 주소 정보에 파라미터를 함께 전달할 수 있습니다. curl -X GET -L http://www.google.com?search=microservice를 입력해 구글에서 microservice를 검색하겠습니다.

GET, DELETE 호출

D:\curl-7.56.1-win64-mingw\bin> curl -X GET -L http://www.google.com?search=microservice

<!doctype html><html itemscope=“” itemtype=“http://schema.org/WebPage" lang=“ko”><head>

<meta content=“text/html; charset=UTF-8” http-equiv=“Content-Type”><meta content=

”/images/branding/googleg/1x/googleg_standard_color_128dp.png” itemprop=“image”>

<title>Google</title><script>(function(){window.google={kEI:‘vDPvWZnNEova8QWQl4XQCw’,

kEXPI:‘1352821,1354276,1354402,1354915,1355217,1355264,1355324,1355735,1355820,1356033, 3700274,3700440,3700476,4029815,4031109,4043492,4045841,4048347,4063220,4072774,4076999, 4078430,4081039,4081165,4082441,4092183,4095909,4097153,4097922,4097929,4098733,4098740, 4098752,4102238,4103474,4103845,4103861,4104258,4104414,4109316,4109489,4110115,4110656, 4111590,4112931,4113217,4114597,4115219,4116349,4116724,4116731,4116926,4116935,4117328, 4117980,4118226,4118798,4119283,4120415,4120660,4120712,4120916,4121035,4121518,4122354, 4122382,4122707,4123641,4123830,4123850,4124090,4124173,4124411,4124850,4125837,4126205, 4126779,4127473,4127744,4127776,4128586,4129520,4129555,4129633,4130362,4130423,4130560, 4130567,4131247,4131732,4131834,4132458,4132531,4132592,4133090,4133114,4133245,4133416, 4134265,4134328,4134946,4135088,4135299,4135576,4135953,4135967,4136221,4136234,4136549, 4136935,4137267,4137513,4137722,4138257,10200083,10202444,10202524,16200026,19003868, 19003924,19003956,19003957,19003958,19003971,19003977,21060957’,authuser:0,kscs: ‘c9c918f0_vDPvWZnNEova8QWQl4XQCw’,u:‘c9c918f0’,kGL:‘KR’};google.kHL=‘ko’;})();

(function(){google.lc=[];google.li=0;google.getEI=function(a){for(var

……


검색 결과 페이지에 대한 HTML 정보가 출력됩니다.

신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.