Skip to content

Allow other methods to be used on curl requests. #145

@john-bv

Description

@john-bv

You currently support the methods for: GET, POST, PUT, DELETE.

The following methods have not been added:

  • PATCH - Modifies a target resource rather than using DELETE & PUT
  • TRACE - Useful for traceback if implemented on the target server.
  • HEAD - Useful for getting only headers, similar to GET
  • OPTIONS - (mainly CORS & prefilighted), While not really useful, you can use it to extract content-type information and related fields.

I imagine we could continue to implement this using the current approach, however maybe adding a "dynamic method task" for executing other request types might be useful for niche use cases? Something like this:

public static function dynamicRequest(string $uri, array|string $args, int $timeout = 10, array $headers = [], array $extraCurlOpts = [], Closure $closure = null): void {
    // .. submit task to threadpool.
}

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