Forum Discussion

Kate's avatar
7 years ago

Empty response (request in python)

I need to retrieve some data using GET request.

Here is a part of my code:

my_conn = http.client.HTTPConnection("")
my_conn.request('GET', '/blahblahblah/.....server_type=35') 
  response = my_conn.getresponse()
  if response.status != 200:
    Log.Error('Did not get info')

I run the same piece of code twice - for server type 35 and for server type 36.
If I run that code in Sublime3 - I get all the data printed out for both server types.

But in TestComplete I got an empty response for both of them.

I added .decode('UTF-8') to

It helped for one request, but did not help for the second one. It is still empty...


Any suggestions?


  • Kate wrote:


    It looks like TestComplete prints my data to the log with WHITE font color.



    Nice feature :)


    What if you will pass all content to the Additional Information tab of the Log?


    Log.Message("Some title",

7 Replies

  • baxatob's avatar
    Community Hero

    Can you show what data is returned by both responses?

    • Kate's avatar


      It should return smth like that:


      and so on.


      In TestComplete I get empty row in the Log.

      • baxatob's avatar
        Community Hero

        Hm... Your code works on my side (with my url) if I use str() method.


        You can try to use a higher level library like urllib or even requests


        Also you can play with timeout argument. A little chance that your default timeout setting is too small.



        http.client.HTTPConnection('your_domain', timeout=10)



        But first of all check that you do not receive an empty response.