BPM, Workflow, and Case

 View Only
Expand all | Collapse all

Setting query parameter to BPMRESTRequest

  • 1.  Setting query parameter to BPMRESTRequest

    Posted Thu October 27, 2022 07:13 PM
    Does BPMRESTRequest have method to set query parameters for GET.
    We are able to invoke POST and PUT by setting parameters to request.parameters. 
    However, GET throws 400 if we set the query parameters to request.parameters.

    ------------------------------
    Manish Poddar
    ------------------------------


  • 2.  RE: Setting query parameter to BPMRESTRequest

    Posted Fri October 28, 2022 04:06 AM
    It works in the same way for GET as for POST. Just ensure that
    your parameters are aligned with path (if you have also path parameters) :

    request.httpMethod = "GET";
    request.path = "/yourApi/goesHere/{pathParameter}";
    request.parameters = { "pathParameter":   "Value1",
                                          "queryParameter": "Value2" }

    will call URL:  /yourApi/goesHere/Value1?queryParameter=Value2

    HTTP 400 means that you sent wrong parameters.
    Your service provider may give you more details – check in response content

    ------------------------------
    Sebastian Tylko
    ------------------------------