Skip to content

Conversation

@hmerritt
Copy link
Contributor

@hmerritt hmerritt commented Jan 10, 2020

Add custom headers to curl request

  • pass headers as an option when using loadFromUrl
$dom->loadFromUrl($url, [
    'curlHeaders' => ['Accept-Language: en-US,en;q=0.5;']
]);

- pass headers as an option when using loadFromUrl
@hmerritt
Copy link
Contributor Author

More than happy to fix the errors in the tests but I am not sure what the error is referring to.

There were 2 errors:

1) DomTest::testLoadFromUrl
Mockery\Exception\NoMatchingExpectationException: No matching handler found for Mockery_0_PHPHtmlParser_CurlInterface::get('http://google.com', []). Either the method was unexpected or its arguments matched no expected argument list for this method

2) StaticDomTest::testLoadFromUrl
Mockery\Exception\NoMatchingExpectationException: No matching handler found for Mockery_0_PHPHtmlParser_CurlInterface::get('http://google.com', []). Either the method was unexpected or its arguments matched no expected argument list for this method

@paquettg paquettg changed the base branch from master to dev/2.2.0 January 12, 2020 21:15
@paquettg paquettg merged commit b48462d into paquettg:dev/2.2.0 Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants