dagu icon indicating copy to clipboard operation
dagu copied to clipboard

Add `json` bool configuration option to HTTP executor

Open yottahmd opened this issue 1 year ago • 3 comments

Overview Add a format option to the HTTP executor configuration.

steps:
  - name: a step
    command: GET https://xxx
    executor:
      type: http
      config:
        format: json
    output: DATA1

This will format the result as standard JSON, including the status code and response headers:

{
  "status_code": 200,
  "headers": [
    "xxx": "yyy"
  ],
  "body": {
    "some_field": "some_value"
  }
}

Additional Context https://github.com/dagu-dev/dagu/discussions/577#discussion-6755295

EDIT: I changed the field type from json: boolean to an format: string for potential future options.

yottahmd avatar May 31 '24 09:05 yottahmd

@yohamta hi , can i try to work on this issue ?

liooooo29 avatar Aug 08 '24 10:08 liooooo29

Hi @halalala222, thank you so much! Yes, please go ahead. Really appreciated.

yottahmd avatar Aug 08 '24 10:08 yottahmd