PHP code example of hvolschenk / http-request

1. Go to this page and download the library: Download hvolschenk/http-request library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hvolschenk / http-request example snippets


GET(void): array;

GETKey(string $key): string;

headers(void): array;

headersKey(string $key): string;

POST(void): array;

POSTKey(string $key): string;


  namespace Sample\Name\Space;
  use function Hvolschenk\HTTPRequest\{ GETKey, headersKey, POST };

  // ...

  if (GETKey('canUpdate') === '1' && doUserAuthCheck(headersKey('Authorization'))) {
    doUserUpdate(POST());
  }