Use HTTPlug instead of Guzzle#6
Use HTTPlug instead of Guzzle#6jasonbosco merged 5 commits intotypesense:masterfrom babeuloula:use-httplug
Conversation
|
Hi, Thanks for the approval. |
jasonbosco
left a comment
There was a problem hiding this comment.
@babeuloula Thank you for this PR!
I did some final sanity checks by running the examples and noticed this error:
$ php collection_operations.php
<pre>--------Create Collection-------
Header values must be RFC 7230 compatible strings
$My PHP knowledge is a little outdated now... Any idea what's wrong? Do the examples run ok in your environment?
Yes, you need to json_encode your body. I've fix that. |
jasonbosco
left a comment
There was a problem hiding this comment.
@babeuloula That error has now gone away, but it now looks like the API key is not being passed to the server. Here's the error I get:
$ php alias_operations.php
<pre>--------Create Collection-------
Forbidden - a valid `x-typesense-api-key` header must be sent.
I've verified that the server and client are configured with the same API key
You have more logs ? Is it possible to have a debug mode on typesense-server ? I don't know why you have this message. I did not changed the logic about the API key. |
|
@babeuloula I dug in a little big more with a debugger and I see the issue: I set a breakpoint on this line and stepped into the Lines 220 to 222 in 3064124 which then takes me to this piece of code in the public function send($method, $uri, array $headers = [], $body = null)
{
return $this->sendRequest($this->messageFactory->createRequest(
$method,
$uri,
$headers,
$body
));
}Notice how the signature of this method is different from how it's being called in So the If you trace this further down the stack, this nested structure eventually causes the |
|
@jasonbosco Sorry, now it's fixed. For monolog, I've change from "^1.0" to "^1.0|^2.1" to allow users to use monolog 2. |
There was a problem hiding this comment.
@babeuloula The examples now work well! Thank you for making those changes.
I just noticed two additional things, could you take a look?
|
Thank you again for the PR @babeuloula! |
|
Published this as |

Change Summary
I want to use your library but I use symfony/http-client. And I can't use it because you use Guzzle. So I made this PR in order to use HTTPlug instead.
I fixed a phpcs error and Late Static Bindings.
PR Checklist