Skip to content

[Curl] Add CURLINFO_EFFECTIVE_METHOD #7595

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

Closed
wants to merge 1 commit into from

Conversation

Ayesh
Copy link
Member

@Ayesh Ayesh commented Oct 19, 2021

Since Curl 7.72.0, it supports a new parameter called CURLINFO_EFFECTIVE_METHOD, which returns the effect method in HTTP(s) requests. This is similar to CURLINFO_EFFECTIVE_URL.

https://curl.se/libcurl/c/CURLINFO_EFFECTIVE_METHOD.html

This adds support for CURLINFO_EFFECTIVE_URL if ext/curl is built with libcurl >= 7.72.0 (0x074800).

$url = "https://example.com";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "data");
curl_exec($ch);
var_dump(curl_getinfo($ch, CURLINFO_EFFECTIVE_METHOD)); // "POST"

Since Curl 7.72.0, it supports a new parameter
called `CURLINFO_EFFECTIVE_METHOD`, which returns the effect method
in HTTP(s) requests. This is similar to `CURLINFO_EFFECTIVE_URL`.

 - https://curl.se/libcurl/c/CURLINFO_EFFECTIVE_METHOD.html

This adds support for CURLINFO_EFFECTIVE_URL if ext/curl is built
with libcurl >= 7.72.0 (0x074800).
@Ayesh Ayesh force-pushed the curl/consts-7-72-0 branch from fc64268 to 9cbccc9 Compare October 20, 2021 15:09
@nikic nikic closed this in d23e36d Oct 21, 2021
@Ayesh
Copy link
Member Author

Ayesh commented Oct 21, 2021

Thank you.

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

Successfully merging this pull request may close these issues.

2 participants