php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #72671 Add support for adding HTTP headers to SolrRequest?
Submitted: 2016-07-25 17:55 UTC Modified: -
From: tandre at ifwe dot co Assigned:
Status: Open Package: solr (PECL)
PHP Version: Irrelevant OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
2 + 14 = ?
Subscribe to this entry?

 
 [2016-07-25 17:55 UTC] tandre at ifwe dot co
Description:
------------
On our java solr servers, we use a custom HTTP header (with a value of the user id) as a part of a key for caching requests, and send that in HTTP requests.

(If the requesting user id is the same as a cache entry, and the query params are the same, the cached result is returned. )

We currently do this via a patched version of this extension, but was wondering if this would be useful elsewhere.

Proposed interface:

// $params is SolrParams or subclass
$params->setHTTPHeader(string $key, string $value) for SolrParams and all subclasses.
(Throwing an exception if $key is reserved)
$params->addHTTPHeader(string $key, string $value)

(Alternately, add it as a possible optional field, called like $client->query($params, ['request_headers' => ['custom_header' => 'value', 'custom_header2' => ['value1', 'value2']]])

If this is useful to others, I should be able to put together a patch.


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 15:01:30 2024 UTC