webMethods

webMethods

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
Expand all | Collapse all

Parameters in multipart/form data in pub.client:http

  • 1.  Parameters in multipart/form data in pub.client:http

    Posted Wed January 20, 2021 01:47 AM
    Hello,
    
    I need to insert 2 parameters with multipart/form-data in pub.client:http. I already put content-type: multipart/form-data in headers and put the parameters inside args, but it didn't work. Anyone knows how to pass 2 parameters multipart/form-data in pub.client:http ???
    
    

    #flow-services
    #webMethods
    #AG-Designer


  • 2.  RE: Parameters in multipart/form data in pub.client:http

    Posted Tue February 02, 2021 03:34 AM

    Hi Sabrina,
    You can the parameters as data in any format i.e. String, bytes or stream.

    What is the error you are seeing?

    image

    Regards,
    Praba.


    #AG-Designer
    #webMethods
    #flow-services


  • 3.  RE: Parameters in multipart/form data in pub.client:http

    Posted Thu February 11, 2021 06:30 PM

    Are you sure you need to use multipart/form-data? Per the documentation,

    When you submit data using args , Integration
    Server automatically sets the value of the Content-
    Type header to application/x-www-formurlencoded.

    This sends the parameters as a query string in the URL for the GET method and in the HTTP body for the POST method. This should be sufficient for typical text arguments.

    The doc continues:

    If you want to explicitly specify a different Content-
    Type value, you must submit the value using the
    string or bytes variable.

    The reason to use multipart/form-data is if the data of one or more of the fields contains lots of non-text data. To use that Content-Type, you’ll need to do more work to create the payload yourself with the pub.mime services.

    Do the 2 fields contain simple text values? If so, use the application/x-www-formurlencoded approach. If not, review the pub.mime services.


    #webMethods
    #AG-Designer
    #flow-services


  • 4.  RE: Parameters in multipart/form data in pub.client:http

    Posted Tue February 16, 2021 03:14 AM

    Hi Shabrina,
    As @ reamon mentioned, you need to use pub.mime services to create a mime object with multiple parts (attachments) and then use to send that stream in the pub.client:http.

    This thread How to send a mimestream using pub.client:http - Forum - Software AG Tech Community & Forums might be useful for you.

    Thanks


    #flow-services
    #webMethods
    #AG-Designer