# Use curl to connect AXIS camera ## Overview :::info **curl basic command** - -v - 顯示詳細數據 - -u username:password - Basic Authentication - -X - 選擇 HTTP method 發佈 HTTP reqeust - -H - 設定 request 裡所攜帶的 header - -d - 攜帶 HTTP POST Data - -F - 模擬表單上傳,將檔案以二進制傳輸 ::: ## Authentications :::info - HTTP 傳輸未加密資料 推薦使用 Digest Authentication - HTTPS 傳輸加密資料 推薦使用 Basic Authentication 避免過度包裝 ::: | Mode | HTTP server | HTTPS server | RTSP server | ------------ | ----------- | ------------ | ------------ | Basic | Basic | Basic | Basic | Digest | Digest | Digest | Digest | Basic_Digest | Digest | Digest | Basic & Digest | Recommended | Digest | Basic | Digest ## API - 顯示APP列表 ``` curl -u <username>:<password> http://<IP>/axis-cgi/applications/list.cgi ``` - 上傳API (未驗證) ``` curl -u <username>:<password> \ -X POST "http://<IP>/axis-cgi/applications/upload.cgi" \ -H "Content-Type: multipart/form-data; boundary=fileboundary" \ -F "packfil=@<APP_name>;type=application/octet-stream" ``` ## AOA - 讀取AOA配置 ``` curl -u <username>:<password> \ -X POST http://<IP>/local/objectanalytics/control.cgi \ -H "Content-Type: application/json" \ -d '{"apiVersion": "1.6", "context": "my context", "method": "getConfigurationCapabilities"}' ```