Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Parasoft BUG - requestBody correlation for x-www-form-urlencoded POST requests

danielasofiei
danielasofiei Posts: 4
edited June 2020 in Virtualize

I came across a problem while trying to correlate or return the requestBody of a POST request x-www-form-urlencoded. Parasoft sees/returns an empty requestBody.
It would work for all request types (GET/PUT/DELETE) but not for POST, is this a bug?
Can confirm that it works for other requestBody types, raw/json/etc.

Comments

  • jakubiak
    jakubiak Posts: 795 admin

    Can you clarify what you mean by "correlate or return the requestBody of a POST x-www-form-urlencoded"? Are you using a REST Client in SOAtest? If so, what configuration are you trying to make to the REST Client? It's not clear to me exactly what you are trying to set up.

  • danielasofiei
    danielasofiei Posts: 4

    Apologies, first time posting here and it shouldn't be posted in SOATest I guess.

    I created a virtual asset in Parasoft Virtualize and I am trying to correlate the response based on a parameter in the request body.

    I am using Postman to test the virtual asset.

    The problem is that the Virtual Asset sees the request body empty when it receives a POST request x-www-form-urlencoded.

  • williammccusker
    williammccusker Posts: 642 ✭✭✭

    Hi,

    Use a correlation on "URL Parameters" the request body of form-urlencoded is treated as parameters by tomcat and other containers so for Virtualize you correlate on them the same way you would for any normal query parameter.

    Hope this helps!

  • danielasofiei
    danielasofiei Posts: 4
    edited August 2020

    Hi William,

    Thank you for your reply, I have tried to correlate on "URL Parameters" matching on the body parameters from request when sending the request type POST and request body x-www-form-urlencoded and the correlation still fails.

  • danielasofiei
    danielasofiei Posts: 4

    Apologies, tried again and it worked.
    Huge thanks!

  • williammccusker
    williammccusker Posts: 642 ✭✭✭

    Glad to hear it worked!