-
Notifications
You must be signed in to change notification settings - Fork 2
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
HTTP request failed due to stream context issue #13
Comments
Can you provide any more context? It looks as though you might be providing an object as opposed to string for the action (second parameter) see
|
Context: The authenticate() method in PardotConnector class is the first method called to get the userKey. This method sends an array with the the parameters for the authentication API call
The send() method then prepares the API call and uses the $parameters to build the $context stream
Then the API request sent throws a HTTP request failed! HTTP/1.0 400 Bad request No changes from the original code were made. In fact, I cloned a fresh copy and tried to run test.php and got the same error. |
Hi again. I updated the send() method so it does not add the stream to the end of the url
This worked. Any feedback? |
I think that the . at the end of
looks like a typo and should be a ; like
There isn't much of a reason to include the parameters here as the context will include that on file get content. See also (the magic-ified class) https://github.com/stephenreid/Pardot-Api-Connector-PHP/blob/master/PardotConnector.class.php#L196 |
Can you Pr and I'll merge? |
Hi. So you want me to fork and you will merge? |
It seems that the file_get_request is not longer opening the stream to send the API request with the proper parameters.
Warning: file_get_contents(https://pi.pardot.com/api/login/version/3/?Resource id #1): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad request in /PardotConnector.class.php on line 389
The text was updated successfully, but these errors were encountered: