Online Documents
繁體中文
繁體中文
  • First Launch Experience
  • How to Train EMILY?
  • Simple Web Automation
  • Web Automation Tools
  • Web Automation Processor
  • User Fill
  • Workspace Script
  • File Exporter
  • File Enumerator
  • EXCEL Processor
  • EXCEL Analyzer
  • EXCEL Writer
  • EXCEL Filler
  • CSV Creator
  • PowerShell
  • PDF Analyzer
  • Mail Sender
  • Mail Reader
  • Exchange Mail Sender
  • Exchange Mail Reader
  • HTTP Analyzer
  • Command Line
  • DOCX Templater
  • SQL Executor
  • Desktop Automation (DA)
  • SFTP
  • JSON API Server
  • Chart
  • DOCX2HTML
  • Folder Processor
  • Google Drive
  • Google Sheets
  • Google OCR
  • Google NLU
  • Azure Form Recognizer
  • Anti-Captcha
  • ChatGPT
  • Gemini
  • Schedule Trigger
  • Mail Trigger
  • File Trigger
  • API Trigger
  • Protect Text
  • Flexibility & Security
  • Announcement
    • Version Releases
    • Third Party Notice
Powered by GitBook
On this page
  • METHOD
  • ENDPOINT
  • HEADERS
  • TEXT / FILE / FORM
  • input 輸入物件
  • output 輸出物件

HTTP Analyzer

發送 HTTP 請求並分析回應

PreviousExchange Mail ReaderNextCommand Line

Last updated 1 year ago

METHOD

選擇發送 HTTP 請求的方法: GET, POST, PUT, DELETE, HEAD

ENDPOINT

接收 HTTP 請求的端點網站,例如: https://api.example.com/version

HEADERS

{
  "Content-Type": "application/json"
}

TEXT / FILE / FORM

選擇請求內容格式,如果請求內容為文字或 JSON 資料格式,請選擇 TEXT,並在 TEXT AS BODY 填寫內容;如果請求內容上傳檔案,則選擇 FILE,並點擊 FILE AS BODY 中的 📎 圖示選取檔案。以上兩種請求內容格式最必須於 HEADERS 指定 Content-Type。

如果選擇 FORM 內容格式,則需以 JSON 資料格式填寫 FormData,但不需要於 HEADERS 中指定 Content-Type,於 FormData 中夾帶檔案必須指名工作資料夾中的檔案名稱並且須具備副檔名,如下面例子,夾帶工作資料夾中的 avatar.jpg 檔案,其欄位名為 "avatar":

{
  "username": "emily",
  "avatar": "avatar.jpg"
}

input 輸入物件

input 輸入物件為 HTTP 回應內容:

// input 輸入物件
{
  url,         // 請求的完整網址 
  status,      // 回應狀態碼
  contentType, // 回應內容的 MIME type
  headers,     // 回應表頭
  body,        // String 或是 Uint8Array  
}

output 輸出物件

加入 output 物件中的每個 key 將被輸出成工作資料夾中的一個 TXT 檔案,檔案名稱即為 key,文字內容為該 key 相對應的 value。

// 將回應中內容輸出到工作資料夾

if (input.contentType === 'application/json') {
  let jsonBody = JSON.parse(input.body)
  _.forEach(jsonBody, (value, key) => {
    output[key] = value
  })
}

if (input.contentType === 'image/png') {
  api.write('result.png', input.body)
}

HTTP 物件,例如:

請求標頭欄位