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

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

Open
john-bv opened this issue Apr 30, 2024 · 0 comments
Open

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

john-bv opened this issue Apr 30, 2024 · 0 comments

Comments

@john-bv
Copy link

john-bv commented Apr 30, 2024

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.
}
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