Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#13240 closed defect (fixed)

JsonRest Store Custom Headers

Reported by: ahenderson Owned by: Kris Zyp
Priority: high Milestone: 1.8
Component: Data Version: 1.7.0b1
Keywords: ObjectStore headers queryOptions Cc:
Blocked By: Blocking:



It is not possible to include custom headers when using the store when wrapped in a


dojox.grid.DataGrid? -> ->

I would like to be able to add extra headers to a query:

var query = dojo.formToObject("myForm");

var queryOpts = {
	headers : {
		"Custom-Header1" : "hello"


When I do this my custom header is not included in the request.

This appears to be down to the JsonRest? store not expecting to receive header options while wrapped in a

Possible Solution:

A possible solution would be to extract the headers from the options object, supporting the or api

query : function(query, options) {
	options = options || {};
	var headers = options.headers || options.queryOptions.headers || {};
	headers.Accept = "application/javascript, application/json";

Will also affect the put method as well.

Change History (4)

comment:1 Changed 11 years ago by bill

Owner: changed from Jared Jurkiewicz to Kris Zyp

comment:2 Changed 10 years ago by Nick Fenwick

I'd like to upvote this issue. I just found that one cannot pass custom headers into JsonRest?.query() when calling it directly. Also, the get() second argument, 'options', is poorly named and undocumented at or

Please, the ability to pass custom headers would be extremely useful. I'm going to have to either stick to passing my security tokens in the query parameters, where it doesn't belong, or create a derived JsonRest? store with a completely replaced query() function, which isn't optimal.

Is there a fix for this in the works, perhaps aimed for 1.8, or is nothing being done? No update on this ticket for 11 months is worrying.

comment:3 Changed 10 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

I believe this was fixed with [28877]

comment:4 Changed 10 years ago by bill

Milestone: tbd1.8
Note: See TracTickets for help on using tickets.