How to use authorization header PHP

前端 未结 2 1648
梦毁少年i
梦毁少年i 2021-01-02 08:57

I am trying to use an authorization header in order to use the vimeo API.

It tells me to do this \'Authorization: basic \' + base64(client_id + \':\' + client_secret

2条回答
  •  一整个雨季
    2021-01-02 09:58

    Vimeo highly recommends you do not write these authentication systems yourself, but use the official libraries: https://github.com/vimeo/vimeo.php.

    If you are looking for a custom PHP integration, it varies based on the way you make HTTP requests. guzzle and curl are both http request libraries, with their own ways of setting headers (http://guzzle.readthedocs.org/en/latest/request-options.html#headers and PHP cURL custom headers)

    As for base64 encoding your tokens, use the method base64_encode (http://php.net/manual/en/function.base64-encode.php)

提交回复
热议问题