예제 #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);
}
예제 #2
0
 /**
  * @test
  */
 public function parseRecognizesHttpsUris()
 {
     assert(Parse::toType('https://example.net/'), equals(HttpUri::fromString('https://example.net/')));
 }
예제 #3
0
 /**
  * @test
  */
 public function validHttpUrlWithoutDnsEntryEvaluatesToFalseWhenTestedForExistance()
 {
     assertFalse(HttpUri::exists('http://stubbles.doesNotExist/', NewCallable::of('checkdnsrr')->mapCall(false)));
 }