OAuth::getRequestHeader

(No version information available, might only be in Git)

OAuth::getRequestHeader β€” Π‘Π³Π΅Π½Π΅Ρ€ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ подпись Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠ° OAuth

ОписаниС

public function OAuth::getRequestHeader(string $http_method, string $url, mixed $extra_parameters = ?): string|false

Π“Π΅Π½Π΅Ρ€ΠΈΡ€ΡƒΠ΅Ρ‚ подпись Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠ° OAuth Π½Π° основС Ρ„ΠΈΠ½Π°Π»ΡŒΠ½ΠΎΠ³ΠΎ ΠΌΠ΅Ρ‚ΠΎΠ΄Π° HTTP, URL ΠΈ Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Ρ… ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΎΠ².

Бписок ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΎΠ²

http_method
HTTP-ΠΌΠ΅Ρ‚ΠΎΠ΄.
url
URL запроса.
extra_parameters
Π‘Ρ‚Ρ€ΠΎΠΊΠ° ΠΈΠ»ΠΈ массив с Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹ΠΌΠΈ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π°ΠΌΠΈ.

Π’ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅ΠΌΡ‹Π΅ значСния

Π‘Ρ‚Ρ€ΠΎΠΊΠ° с Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΎΠΌ запроса ΠΈΠ»ΠΈ false, Ссли Π²ΠΎΠ·Π½ΠΈΠΊΠ»Π° ошибка

οΌ‹Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ

ΠŸΡ€ΠΈΠΌΠ΅Ρ‡Π°Π½ΠΈΡ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ 1 note

up
8
me at chrishowie dot com ΒΆ
9 years ago
The documentation does not specify the difference between passing a string and passing an array for the third parameter.  We spent two days debugging before reading the C source code to figure out that there is a significant and undocumented difference between the two.

"a=1" and array("a" => 1) are handled very differently!

If you are making a POST/PUT request (or anything with an entity body) then you should pass that as a string.

If you are making a request with a query string, you should pass that as an associative array.

If you pass "a=1" intending that to specify the query string, the generated signature will be invalid -- it will process this as if you were POSTing the content "a=1" instead.