Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you use the process option? #61

Open
Jakobud opened this issue May 30, 2017 · 0 comments
Open

How do you use the process option? #61

Jakobud opened this issue May 30, 2017 · 0 comments

Comments

@Jakobud
Copy link

Jakobud commented May 30, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant