Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html5qp does not use stream contexts properly #8

Closed
jakejackson1 opened this issue Dec 7, 2022 · 1 comment
Closed

html5qp does not use stream contexts properly #8

jakejackson1 opened this issue Dec 7, 2022 · 1 comment

Comments

@jakejackson1
Copy link
Member

From querypath created by letapjar: technosophos/querypath#189

When trying to access an external resource via POST - apparently the html5qp function does not use the passed in stream context

$options = array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $payload, ), ); $context = stream_context_create($options); $qp = html5qp($url, null, array('context' => $context));

The above code fails to open the resource - because the Masterminds HTML5 apparently tries to use a FileInputStream to grab the url.

When I switch to htmlqp the streamcontext is properly used and the code works.

I'm not sure if this is by design for HTML5 or if this is a bug - and if it is - whether it's an issue for QP or Masterminds\HTML5

@jakejackson1
Copy link
Member Author

My workaround for now is to call file_get_contents myself using the streamcontext and then pass that resource in to html5qp to get a querypath object with HTML5.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant