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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tandre at ifwe dot co
New email:
PHP Version: OS:

 

 [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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC