Management Pack Builder

 View Only
Expand all | Collapse all

Request using Content Type: application/x-www-form-urlencoded is not working

  • 1.  Request using Content Type: application/x-www-form-urlencoded is not working

    Posted Nov 02, 2023 08:50 AM

    Hi All,

    we are trying to build vrops management pack using builder (1.1.2). The application we are building pack support Content Type: application/x-www-form-urlencoded request to get token .. using rest tool we could see expected output.

    But from builder we see  response "Failed with error code 400: Bad Request"..

    attached screenshots for references and log files.

    Request to provide solution to above issue.

    Attachment(s)

    pdf
    issue.pdf   547 KB 1 version


  • 2.  RE: Request using Content Type: application/x-www-form-urlencoded is not working

    Broadcom Employee
    Posted Nov 03, 2023 05:01 PM

    Hi  

    Thanks for bringing this to our attention. We found a bug with how the MP Builder handles the x-www-form-urlencoded content type. The MP Builder is adding unnecessary escape characters before sending the HTTP request.

    I'll provide another update when we have an ETA on the fix.

    Best regards,
    Mark



  • 3.  RE: Request using Content Type: application/x-www-form-urlencoded is not working

    Posted Nov 29, 2023 03:36 PM

    Has there been any update on this? 

    The bulk of our APIs require session generation, with passing of the credentials in the body via x-www-form-urlencoded, so as of now, we unfortunately cannot do anything with the MP builder as keen as we are to start. 



  • 4.  RE: Request using Content Type: application/x-www-form-urlencoded is not working

    Broadcom Employee
    Posted Nov 29, 2023 08:19 PM

    Hi ,

    We have the fix nearly ready and should be publishing it within the next few days.

    Best regards,

    Mark



  • 5.  RE: Request using Content Type: application/x-www-form-urlencoded is not working

    Broadcom Employee
    Posted Dec 04, 2023 04:09 PM

    Hi  and 

    The Management Pack Builder 1.1.3 OVA has been published to the marketplace page. This includes a fix for x-www-form-urlencoded. You can export your design from your current deployment and import it to the new VM.

    If you prefer to upgrade your existing Management Pack Builder instance, we will be providing an upgrade binary later this week.

    Best regards,

    Mark



  • 6.  RE: Request using Content Type: application/x-www-form-urlencoded is not working

    Posted Dec 06, 2023 07:23 AM

    When using the pack builder;

    {

    "error": "invalid_grant",

    "error_description": "Invalid user credentials"

    }

    When using the same request outside of the management pack builder - with Curl,Python,Powershell or Postman etc. with the same application/x-www-form-urlencoded body, it works fine.



  • 7.  RE: Request using Content Type: application/x-www-form-urlencoded is not working

    Posted Dec 06, 2023 03:38 PM

    It even works from curl if I log into the appliance directly via SSH and run the curl command that reflects the API call I am trying to make via the pack builder gui. There must be further logs to look at? 



  • 8.  RE: Request using Content Type: application/x-www-form-urlencoded is not working

    Broadcom Employee
    Posted Dec 06, 2023 05:19 PM

    Hi ,

    Please double-check a few things:

    - The HTTP Method is set to POST.

    - Under advanced, a header is added with key "Content-Type" and value "application/x-www-form-urlencoded"

    - Under advanced, the body is in query parameter format. Example:

    key1=value&key2=value2

    - If curl is doing any automatic character encoding of the body before sending the request, you'll probably need to do the same encoding manually before entering it into the Body field in MP Builder.

    Attaching a couple screenshots for reference. The request log in the UI is the best log to look at. If the tips above don't help, please send the body of your request so we can verify the format. We'd also be happy to jump on a call to take a look directly. You can reach me directly at mark.arbogast@broadcom.com.



  • 9.  RE: Request using Content Type: application/x-www-form-urlencoded is not working

    Posted Mar 29, 2024 09:22 PM

    My marketplace page only displays versions 1.0 & 1.1.2 for download.  Has 1.1.3 been rescinded? 



  • 10.  RE: Request using Content Type: application/x-www-form-urlencoded is not working

    Broadcom Employee
    Posted Apr 01, 2024 12:48 PM

    Hi ,

    v1.1.3 should still be available, but I'm also not seeing it on the marketplace. We will look to get it re-published but it may take a couple weeks. Feel free to reach out to us directly at mp-builder-dev.pdl@broadcom.com and we can find another way to provide the build in the meantime.

    Best regards,
    Mark



  • 11.  RE: Request using Content Type: application/x-www-form-urlencoded is not working

    Posted Dec 08, 2023 10:05 AM
      |   view attached

    Hi Mark,

    Thank You. using new release version 1.1.3 had fixed the issue.

    I tried to import developed build file into MB GUI and configured the environment and new release of the product and have to overwrite existing url for session ( as this got changed in new release).

    Saw one concern after fixing sessions noticed event tab definition are lost ( its difficult to track what was configured ) and definitions have mandatory dependency on objects/instance should exists in connected env.

     PFA for ref screenshots.

    Attachment(s)

    pdf
    Concerns.pdf   389 KB 1 version


  • 12.  RE: Request using Content Type: application/x-www-form-urlencoded is not working

    Broadcom Employee
    Posted Dec 08, 2023 08:01 PM

    Hi ,

    Glad to hear you were able to get past the x-www-form-urlencoded issue with 1.1.3.

    Thanks for the detailed write-up. Regarding item 1: you can use a custom configuration field to avoid having to manually update the version in every request for v2, v3, etc. To do this, create the new config field then copy and paste the Usage variable into each request's path. Then in future API versions you would just need to update the "Value" and "Default" of the API version in one place. Here's a quick demo: https://recordit.co/PhnYGX5BkM

    Regarding item 2:

    Sorry that the original response data was lost when you re-deployed the VM - that is frustrating. We remove all environment / customer-specific data (e.g., responses) from the exported design JSON so that MP designs can be shared safely. For future MP Builder versions we'll investigate an option to include response data with the design.

    Also, we normally suggest upgrading in-place vs. re-deploying a new VM, which will preserve the response data. For future releases we will provide the in-place upgrade tarball at the same time as the new OVA. 

    Best regards,

    Mark