DataPower

DataPower

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Send multipart/form-data using xslt

    Posted 08/25/24 09:52 AM

    Need help on below,

    I have below Input XML to Data power From MQ and I need to call the backend as "multipart/form-data" using xslt . Can you please guide me on this 

    <ExternalAPI>
    <Request>
    <HTTPHeaders>
    <Header>
    <Name>Content-Type</Name>
    <Value>multipart/form-data; boundary=----111111</Value>
    </Header>
    <Header>
    <Name>Accept</Name>
    <Value>application/json</Value>
    </Header>
    <Header>
    <Name>in-auth-token</Name>
    <Value>token</Value>
    </Header>
    </HTTPHeaders>
    <LOB>ImportDocuments</LOB>
    <HTTPMethod>POST</HTTPMethod>
    <url>https://uatsellonline.takafuloman.om/api/v1/document/attach</url>
    <Payload>
    ------111111
    Content-Disposition: form-data; name="document_id"
    DT000000014545
    ------111111
    Content-Disposition: form-data; name="document_type"
    Total Files
    ------111111
    Content-Disposition: form-data; name="name"
    taoi-logo.png
    ------111111
    Content-Disposition: form-data; name="document_desc"
    Total Files
    ------111111
    Content-Disposition: form-data; name="file"
    11111111
    ------111111--</Payload>
    </Request>
    </ExternalAPI>


    ------------------------------
    Anil Nayak
    ------------------------------


  • 2.  RE: Send multipart/form-data using xslt

    Posted 08/26/24 01:55 AM

    Hi Anil,

    GatewayScript would be a lot easier option, check this thread from last year:

    https://community.ibm.com/community/user/integration/discussion/send-multipartform-data-in-xst

    And if you can manage with multipart/related, DataPower creates the multipart automatically nowadays:

    https://community.ibm.com/community/user/integration/blogs/hermanni-pernaa1/2023/10/05/simple-attachment-processing

    Hope these help!



    ------------------------------
    Hermanni Pernaa
    ------------------------------