Forum Discussion

harshabongle's avatar
harshabongle
Occasional Contributor
4 years ago
Solved

Getting 400 bad request, but the same test case when executed in a different machine runs successful

Hi,

I am getting 400 bad request. But when the same test case is exported (as xml) and executed in a different machine, it runs successfully !! Its really weird. Please help.

 

 

 

Thanks,

harsha

  • richie's avatar
    richie
    4 years ago
    Hey harshabongle,

    Apologies. I thought id already responded to this.

    Youre getting a 400 so it means theres no authentication/authorisation issue, this is a problem with the request itself and typically id look at the payload of your request. However, the fact that the same project works on a different machine complicates the issue.
    Have you checked/compared the system properties to check versioning of all the relevant software (readyapi!, java, etc.).

    Have you tried exporting the project from the working machine and importing into your readyapi! instance that is failing with the 400?

    Either way, when i get problems like this i use Fiddler to proxy and capture the requests/responses for comparison.

    So id proxy the request with fiddler via the imnstance generating the 400 and capture the RAW request details.
    Id repeat on the machine that is getting a successful request so i could compare the two.
    Id suggest there should be a difference when you compare the RAW request details. Identifying the difference could help you work out a fix for the issue.

    Ta

    Rich

3 Replies

    • richie's avatar
      richie
      Community Hero
      Hey harshabongle,

      Apologies. I thought id already responded to this.

      Youre getting a 400 so it means theres no authentication/authorisation issue, this is a problem with the request itself and typically id look at the payload of your request. However, the fact that the same project works on a different machine complicates the issue.
      Have you checked/compared the system properties to check versioning of all the relevant software (readyapi!, java, etc.).

      Have you tried exporting the project from the working machine and importing into your readyapi! instance that is failing with the 400?

      Either way, when i get problems like this i use Fiddler to proxy and capture the requests/responses for comparison.

      So id proxy the request with fiddler via the imnstance generating the 400 and capture the RAW request details.
      Id repeat on the machine that is getting a successful request so i could compare the two.
      Id suggest there should be a difference when you compare the RAW request details. Identifying the difference could help you work out a fix for the issue.

      Ta

      Rich
      • harshabongle's avatar
        harshabongle
        Occasional Contributor

        Thanks richie . This is happening because of a header that I didnot populate. The error got resolved after adding a value to the header.