Forum Discussion

MojoLA's avatar
MojoLA
Occasional Contributor
7 years ago

When a resource has both GET and POST methods, I can't add POST to a TestCase

I imported a Swagger definition to create a Project. Several of my REST resources have both GET and POST methods -- two different ways to pass in parameters. (I didn't write this API.)

 

See this screenshot for example:

 

When I attempt to add the POST version of the resource, it will only give me the GET version, with a list of request parameters. I can't change the method to POST.

 

I've tried creating a "New REST service from URL" to manually accommodate the POST versions of requests, but that has its own problems, which I'll mention in a different post.

 

4 Replies

  • bilgvvn's avatar
    bilgvvn
    Occasional Contributor

    Create Testsuite and add your test cases for Get and Post requests. 

    • MojoLA's avatar
      MojoLA
      Occasional Contributor

      Thanks for the suggestion. This "creates a new REST service and a REST Request test step for it."

       

      When I specify the URL as ${#Project#Endpoint}${#Project#basepath}/resource it tells me I have an invalid URL. If I use a "real" URL, then edit the path later, it generates extra slashes that I can't remove.

       

      Grr.

      • MojoLA's avatar
        MojoLA
        Occasional Contributor

        Example: I created a new TestSuite and a new REST method, as a POST, and gave it a URL of http://localhost:8080/playlist/findPlaylist

         

        So now I have an empty TestCase. I can edit the Endpoint to be ${#Project#Endpoint} but there's no way to edit the resource field to make it ${#Project#basepath}/findPlaylist.

         

        no luck.