Layer7 API Management

  • 1.  Access Form Data in Gateway

    Posted Nov 14, 2017 04:07 AM

    Hi guys I am using Gateway 9.1

    I am sending form-data which has a file(json or csv) & some fields(see attached pic) . How can I access the data in Gateway service?

     

    Thanks

     

    --edit--

    I tried using ${request.parts.1.body} but it doesnt work.

    dasjo02 Any help is appreciated



  • 2.  Re: Access Form Data in Gateway

    Posted Nov 14, 2017 11:00 AM

    have you tried 

     

    ${request.parts.1} ${request.parts.2} ${request.parts.3}


    or ${request.parts.2.body} ... 

     

    do you get an audit warning, something about content type ....

     

    you might have to add that content type into a CWP as value of contentType.otherTextualType cluster-wide property



  • 3.  Re: Access Form Data in Gateway

    Posted Nov 14, 2017 11:20 AM

    Hi ajake01, no I did not try the other context variables.

    I do not have access to environment as of now, so i can try them tomorrow & update you.

     

    FYI  ${request.parts.1.body} worked if I only use file in form-data.

    If I add file & key value field in form-data as seen in my first post it is not working.

     

    If you have any sample service please share, it would be of great help.

     

    Thanks



  • 4.  Re: Access Form Data in Gateway
    Best Answer

    Posted Nov 14, 2017 11:26 AM

    we would want to see what audit warning error you get ...
    or maybe open a case with support for detailed troubleshooting  



  • 5.  Re: Access Form Data in Gateway

    Posted Jan 10, 2018 02:42 AM

    Hi siddharth-b

     

    I had the same problem where I am sending a .cer certificate file (by default it only accepts .txt/.xml/.json files) and a key/value pair in a POST request to the gateway.

     

     

    after a bit of troubleshooting I was able to capture the parameters once I added the cluster-wide property "contentType.otherTextualType" and set its value as:

     

    application/pkix-cert
    application/octet-stream

     

     

     

    Could you please share your solution if you were able to get this problem solved through any other means?