curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Curl Enhancement: ignoring specific HTTP status codes while failing on others

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 5 Jan 2021 15:43:10 +0100 (CET)

On Tue, 5 Jan 2021, Xander Bos via curl-library wrote:

> In our application, there are certain HTTP error codes that we would like to
> handle ourselves, while we'd like libcurl to handle the rest. What I propose
> is to add a configuration option so that we can let these status codes fall
> through as if they returned CURLE_OK, while letting all other error codes be
> handled by curl. The option could be named something like:
> CURLOPT_HTTP_IGNORE_STATUSCODES, and given multiple long values that can be
> checked in the `http_should_fail` function.

Can you elaborate on why or how you came up with this requirement? It seems
very niche to me.

Also, can't you just do the special magic for this in your header callback and
thus avoid having to change libcurl all together?

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2021-01-05