0
단일 세션에서 여러 게시물 요청을 보내기위한 perl 스크립트 작성. 따라서 첫 번째 요청을 보낼 때마다 세션 ID가 반환됩니다. 동일한 세션 ID로 다음 요청을 수행해야합니다. HTTP 헤더에 해당 세션을 포함시키는 방법. http : 쿠키 헤더를 사용하고 싶지 않습니다. http 헤더에 직접 세션 ID를 전달할 수 있습니까? ? (가 작동하지 않음)http post 요청에 대한 wirte perl 스크립트 (이전 resd 포함)
샘플 코드는
$server_endpoint = "https://ip/nitro/v1/discovery/device_registration";
$post_data = '{"device_registration":{"device_ipaddress":"ip","device_family":"CB"}}';
$req = HTTP::Request->new(POST => $server_endpoint);
$req->header('content-type' => 'application/json');
$req->header('cookie' => 'sessionid=$sessionid;'); # can I avoid setting a cookie?
$req->content($post_data);
그래서 UI에서 가져 오는 방법을보고 싶다면 어떻게 확인하나요? – Kranthi
내가 말했듯이 API 설명서를 확인해야합니다. 이것은 당신이 쓰고있는 서비스입니까? http://support.citrix.com/servlet/KbServlet/download/30602-102-681756/NS-Nitro-Gettingstarted-guide.pdf이 문서에서는 인증 토큰을 실제로 HTTP 쿠키로 전달해야한다고 제안합니다. –