Exemplo n.º 1
0
/**
 * creates a http connection to specified uri
 * @param   string                         $uri
 * @param   \stubbles\peer\HeaderList  $headers
 * @return  \stubbles\peer\http\HttpConnection
 * @since   3.1.0
 * @api
 */
function http(string $uri, HeaderList $headers = null) : HttpConnection
{
    return HttpUri::fromString($uri)->connect($headers);
}
Exemplo n.º 2
0
 /**
  * @test
  */
 public function parseRecognizesHttpsUris()
 {
     assert(Parse::toType('https://example.net/'), equals(HttpUri::fromString('https://example.net/')));
 }
Exemplo n.º 3
0
 /**
  * @test
  */
 public function validHttpUrlWithoutDnsEntryEvaluatesToFalseWhenTestedForExistance()
 {
     assertFalse(HttpUri::exists('http://stubbles.doesNotExist/', NewCallable::of('checkdnsrr')->mapCall(false)));
 }