[OpenLayers-Users] Setting default header parameter for all ajax requests

Christopher Schmidt crschmidt at metacarta.com
Tue Apr 28 12:51:38 EDT 2009


On Tue, Apr 28, 2009 at 06:45:17PM +0200, Milan Antonovic wrote:
> Hi all,
> I have a question for you..
> I would like to set the default header parameter for all the openlayers ajax
> request, even that used by OpenLayers.Layer.Wms.

WMS requests don't go through AJAX, so this is not possible in the
current OpenLayers code. (They are requested via <img>, which does not
have support for adding headers.)

-- Chris


> That's because I need to set the "Authorization" parameter in the header
> with user and password for my WMS Layers.
> 
> I've tried with:
> 
> OpenLayers.Util.extend(
>   OpenLayers.Request.DEFAULT_CONFIG,
>   {
>     headers: {Authorization: "BASIC " + usrPsw}
>   }
> );
> 
> But when I look at the request header sent it does not appear..
> 
> Help [?]
> 
> my rgds
> 
> Milan



> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list