Forum Discussion

Parthib's avatar
Parthib
New Contributor
3 years ago

Am getting connection refused error in ready API

When am sending the below two different URL in single http request am getting connection refused error in Ready API

 

Sample Request URL :

 

https://d.org/k/o/r/r/r/a-n-i/a?client_id=a&response_type=c&scope=o%2%20ect_uri=http://localhost:4200&nonce=t=t

 

Note : Since due to business policy i have not share the original URL Details

 

Error Message:

 

2022-06-23 19:01:40.678 - Error getting response; org.apache.http.conn.HttpHostConnectException: Connect to localhost:4200 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect

 

 

  • Hi,

    Is the second URL a parameter for the API or are you trying to call two different URLs in the same request?

7 Replies

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    Hi,

    Is the second URL a parameter for the API or are you trying to call two different URLs in the same request?

  • Parthib's avatar
    Parthib
    New Contributor

    Hi,

     

    Thanks for Quick Response

     

    Its a two different URL in single request

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    Hi,

     

    In short, you cannot call two URLs in a single test request.  You need to make a test request per URL to test different URLs.

     

    If you have the licensed ReadyAPI, then look at Environments.  That might help with different URLs.

     

    For example, if you have a getCustomer API in a Dev and Test environment.  Then you would have two different URLs and you can switch between the two.

  • Parthib's avatar
    Parthib
    New Contributor

    Hi,

     

    Yes am licensed user of Ready API understood the switching between the two environment,

     

    But here in the same request when i tryied to perform scenario in POSTMAN that's giving the expected response.

     

    Is any other option to test in ReadyAPI even i tried to pass the another URL in request parameter that also not working now.

     

    Thanks,

    Parthib

  • Parthib's avatar
    Parthib
    New Contributor

    Hi, 

     

    Another issue is when am sending the request with below parameters

     

     

    After checking request raw it displayed as below format value.

     

     

    Could you please help me out to solve this issue.

     

    Thanks,

    Parthib

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    ,

     

    So the second URL is a parameter, it's redirect_uri.  OK, let me have a look.

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    Hi,

     

    I've managed to send a URL in the request params.

     

    Note the type, for me I use Query and not Template.

     

    And my raw request....

     

    I know Postman uses {} to interpolate, but it's not required here.

     

    You can though interpolate, but ReadyAPI uses ${} and not {}.

     

    E.g. I have set up a custom property for my test under the Test Suite name...

     

     

    Then, in the test step....

     

     

    And finally, in the raw request tab....