Can only read one query parameter from StaplerRequest

25 views
Skip to first unread message

Tomas Bjerre

unread,
Aug 31, 2018, 1:32:17 PM8/31/18
to Jenkins Developers
I have a class like this:.

...
@Extension
public class GenericWebHookRequestReceiver extends CrumbExclusion implements UnprotectedRootAction {

  private static final Logger LOGGER =
      Logger.getLogger(GenericWebHookRequestReceiver.class.getName());

  public HttpResponse doInvoke(final StaplerRequest request) {
    LOGGER.info("URL: " + request.getRequestURLWithQueryString());
    LOGGER.info("Keyset: " + request.getParameterMap().keySet())
...


When I invoke this with:



I can see in the log:



I was expecting param1 and param2 to be available in the keyset. Any hints on what I'm doing wrong here?



Daniel Beck

unread,
Aug 31, 2018, 1:33:56 PM8/31/18
to jenkin...@googlegroups.com
This has nothing to do with Jenkins. & is a shell meta character. Single-quote the entire URL and it'll work.

Tomas Bjerre

unread,
Aug 31, 2018, 1:37:25 PM8/31/18
to Jenkins Developers
Thanks =)
Reply all
Reply to author
Forward
0 new messages