So you are programming an OpenLayers based map viewer and attempt to make a WMS GetFeatureInfo request, whose response will later be pretty-formatted and shown to the user. To accomplish it you create JavaScript code like the following:
var parameters = {
srs: map.getProjection(),
bbox: map.getExtent().toBBOX(6),
width: map.getSize().w,
height: map.getSize().h,
x: evt.xy.x,
y: evt.xy.y,
layers: 'municipalities',
query_layers: 'municipalities'
};
OpenLayers.Request.issue({
method: 'get',
url: this.getFeatureInfoUrl,
async: false,
params: parameters,
success: function(data) {
var responseText = data.responseText;
// ...
}
});
where evt (lines 6 and 7) represents the mouse click event that triggered the GetFeatureInfo request.