Forum Discussion

GregRESO's avatar
GregRESO
Occasional Contributor
8 years ago

Edit and Submit RAW request without using "Request" tab

I would like to change the RAW submission to the server I'm testing. (Specifically to do some negative testing.)

Using the "Request" tab, I'm forced to enter a "true" value into the "$count" parameter to get it to appear.

 

I want to only have "/Public/Property?$count" in the request and not the full "/Public/Property?$count=true" 

 

 

There are other ways that I'd like to force bad GET requests just to see how my servers respond. 

 

Can the RAW requests be edited to something other than what is generated on the "Request" tab?

 

Thanks

8 Replies

  • Hi Greg,

     

    I looked into this and initially thought you could achieve this with an Event handler of type RequestFilter.filterRequest, which is a good Swiss army knife for modifying requests in various way, but it turns out that direct manipulation of the query string is a bit too low level.

     

    It'd be great to have an event handler that fires just before you're sending the request, and I will make a feature request about just that.

     

    Meanwhile, I hope that the workaround you came up with is OK.

     

    Regards,

    Manne, Ready! API developer

    • GregRESO's avatar
      GregRESO
      Occasional Contributor

      Hi Manne,

       

      Thanks for the reply. I'm pretty new to this kind of development and using this tool. Could you explain where in the Ready API to edit the Event Handler?


      Thanks, Greg

  • Hi!

     

    for this specific case you can set the query parameter to be required in the corresponding REST Method definition - which should result it being sent with an empty value

     

    /Ole

    • GregRESO's avatar
      GregRESO
      Occasional Contributor

      Based on the comments. This is what I did. (For future reference):

       

      But when I did this, the parameter still had the "=" at the end of the GET request:

       

       

       

       

      • OLensmar's avatar
        OLensmar
        Staff

        Hi!

         

        yes - you're right - that's "expected" behaviour :-(

         

        Another alternative to try is to create a HTTP Request TestStep instead of a REST TestStep in your TestCase and simply hardcode the endpoint to contain your query-argument - does that work?

         

        /Ole