DataPower

 View Only
  • 1.  Multi-Protocol Gateway with application/x-www-form-urlencoded request

    Posted Mon January 06, 2025 09:27 AM

    I have an api that wait for application/x-www-form-urlencoded  data like in attached photo and I have mpgw with tansform with xslt file I want to know how to transform data to be send in this format using xslt and if there is any further configuration must be done to send req with this format 



    ------------------------------
    omair waleed
    ------------------------------


  • 2.  RE: Multi-Protocol Gateway with application/x-www-form-urlencoded request

    Posted Tue January 07, 2025 03:06 PM

    Hi Omair,

    You can look at the bottom post here https://community.ibm.com/community/user/integration/discussion/posting-form-data-using-dpurl-open-from-xslt-in-datapower

    There is an example about posting HTTP body content with xslt dp:url-open using the same Content-Type (x-www-form-urlencoded).  Sometimes you would also want to use multipart to separate the post data into sections (eg. a post body, but also the image as its own).  You would just need to follow the header rules and delimiters for multipart data.  You can see more on that topic here: https://stackoverflow.com/questions/60030128/converting-application-pdf-text-html-data-to-multipart-form-data-in-datapower -- usually GatewayScript is used since it can be considered easier to write the multipart data than in XSLT.



    ------------------------------
    DOMINIC MICALE
    ------------------------------



  • 3.  RE: Multi-Protocol Gateway with application/x-www-form-urlencoded request

    Posted Mon January 13, 2025 09:12 AM
    You can use XSLT to transform your data into the application/x-www-form-urlencoded format required by your API. Here's a basic approach and considerations:


    ------------------------------
    Para PC
    ------------------------------