Forum Discussion

simpleseb's avatar
simpleseb
New Contributor
15 years ago

HTTP-Status Code

Hi,

I have a REST-Testcase where I want to check whether the HTTP-Status code of an HTTP-Response, which does _not_ have any content, is 200 and not 403 or 500.
Sounds quite easy, but the assertions always return the error 'null/empty response'. The Raw-View says among others 'HTTP/1.1 200 OK'.
So I modified the HTTP-Response so that it has a content, and the tests work just fine.
Is this a bug or a feature?

Thanks,
seb

3 Replies

  • simpleseb's avatar
    simpleseb
    New Contributor
    I forgot the version info:
    soapUI 4.0-beta1 on Ubuntu 10.04 64bit
  • oysteigi's avatar
    oysteigi
    Occasional Contributor
    Hi,

    I just ran into the same bug. I would say the current behaviour is OK with SOAP responses (you should always get a response), but there are legitimate cases with REST-responses where you have no content, but rely on the HTTP status code.

    I've checked out the latest code and the problem is still not solved. I suggest changing ValidHttpStatusCodesAssertion and InvalidHttpStatusCodesAssertion to allow empty responses. I cannot see any negative consequences, but this should be verified by a developer familiar with this code. See the attached patch (renamed to .txt because .patch is not allowed in this forum!!!).
  • Hello,

    Yes, you are right. Fix will be included in upcoming nightly build.

    Thank you for reporting,
    robert
    /SmartBear Sweden