Skip to content

Allow to set CURLOPT_FORBID_REUSE when constructing http curl client #40482

@simPod

Description

@simPod

Description

Currently, CurlHttpClient has a set of allowed options that can be passed on construction and then they're converted to curl opts internally.

However, the CURLOPT_FORBID_REUSE is not mapped to any option and therefore it's impossible to use when relying on PSR interfaces.
Symfony request() method allows to pass options through 3rd arg via extra.curl but I don't want to use that option nor interface as it exposes implementation details.

I'm making http requests to devices that has unreliably implemented HTTP. Therefore it is required to force TCP connection to close in order to enforce some stability. And that's done using CURLOPT_FORBID_REUSE.

Example

Would it make sense to add forbid_reuse: true|false option that can be passed into new CurlHttpClient(['forbid_reuse': false])? I don't see any other way to do so.

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