Skip to content

How do you use the process option? #61

Description

@Jakobud

I'm using curlrequest to fetch some remote files from a web server and save them locally (using curl's "output" option). If the response is a 404, it saves the 404 HTML page as the local file.

How can I do things like check the response before taking action? I'm seeing the process option but not sure how to use it. I tried this:

let options = {
  ...
  process: res => {
    console.log(res)
  }
}

but that didn't seem to do anything. It says you pass a function. Not sure.

Is it possible to do what I want?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions