Closed mehmetbilgin closed 9 years ago
Hi @mehmetbilgin ,
The best way to do it is to write a neoclient extension. I need definitely to write a blog post about how to do it and link it into the doc.
In the meantime, you may want to look how I created extensions for spatial and timetree :
I managed to write the extension looking at the examples you gave, but my unchecked extension returning json stream. Looks like setting header option "Accept: application/json" (in GuzzleHttpClient.php) causing error with the request.
Hello @mehmetbilgin ,
Thanks for your feedback. You mark a good point, the client is made to send only json http requests. And I'm aware now that somebody may have the need to send anything else than json.
I will try to find a "temporary fix" for the 2.x version of the client. Thanks for using the library and to report here.
@mehmetbilgin
I have pushed a new branch "custom-headers", if you would like to see if it fit your needs it would be cool.
In the execute method of your new Command you can now pass a last parameter to the ->process()
method call :
public function execute()
{
return $this->process(self::METHOD, self::PATH, $this->prepareBody(), $this->connection, null, $this->queryMode, $headers);
}
$headers has to be an array of headers where keys are the header name and value the header value, it will override default headers the GuzzleHttpClient has.
e.g. :
$headers = ['Content-Type' => 'application/text'];
Thanks for the quick fix. I will be able to try it tomorrow and let you know the outcome.
Thank you.
Sorry for delayed response. I've tested it and it works. Are you planning to merge it back to 2.x branch?
Cool. Yes I will merge it in 2.x
This has been merged into master, and released with 2.1.14 tag
Hi Christophe,
I wrote a server plugin and I want to call this new plugin using your bundle. Is it possible? Do I need to create a new command (that extends AbstractCommand)?