@@ -35,13 +35,13 @@ def run_test(self):
3535
3636 conn = httplib .HTTPConnection (url .hostname , url .port )
3737 conn .connect ()
38- conn .request ('GET ' , '/' , '{"method": "getbestblockhash"}' , headers )
38+ conn .request ('POST ' , '/' , '{"method": "getbestblockhash"}' , headers )
3939 out1 = conn .getresponse ().read ();
4040 assert_equal ('"error":null' in out1 , True )
4141 assert_equal (conn .sock != None , True ) #according to http/1.1 connection must still be open!
4242
4343 #send 2nd request without closing connection
44- conn .request ('GET ' , '/' , '{"method": "getchaintips"}' , headers )
44+ conn .request ('POST ' , '/' , '{"method": "getchaintips"}' , headers )
4545 out2 = conn .getresponse ().read ();
4646 assert_equal ('"error":null' in out1 , True ) #must also response with a correct json-rpc message
4747 assert_equal (conn .sock != None , True ) #according to http/1.1 connection must still be open!
@@ -52,13 +52,13 @@ def run_test(self):
5252
5353 conn = httplib .HTTPConnection (url .hostname , url .port )
5454 conn .connect ()
55- conn .request ('GET ' , '/' , '{"method": "getbestblockhash"}' , headers )
55+ conn .request ('POST ' , '/' , '{"method": "getbestblockhash"}' , headers )
5656 out1 = conn .getresponse ().read ();
5757 assert_equal ('"error":null' in out1 , True )
5858 assert_equal (conn .sock != None , True ) #according to http/1.1 connection must still be open!
5959
6060 #send 2nd request without closing connection
61- conn .request ('GET ' , '/' , '{"method": "getchaintips"}' , headers )
61+ conn .request ('POST ' , '/' , '{"method": "getchaintips"}' , headers )
6262 out2 = conn .getresponse ().read ();
6363 assert_equal ('"error":null' in out1 , True ) #must also response with a correct json-rpc message
6464 assert_equal (conn .sock != None , True ) #according to http/1.1 connection must still be open!
@@ -69,7 +69,7 @@ def run_test(self):
6969
7070 conn = httplib .HTTPConnection (url .hostname , url .port )
7171 conn .connect ()
72- conn .request ('GET ' , '/' , '{"method": "getbestblockhash"}' , headers )
72+ conn .request ('POST ' , '/' , '{"method": "getbestblockhash"}' , headers )
7373 out1 = conn .getresponse ().read ();
7474 assert_equal ('"error":null' in out1 , True )
7575 assert_equal (conn .sock != None , False ) #now the connection must be closed after the response
@@ -81,7 +81,7 @@ def run_test(self):
8181
8282 conn = httplib .HTTPConnection (urlNode1 .hostname , urlNode1 .port )
8383 conn .connect ()
84- conn .request ('GET ' , '/' , '{"method": "getbestblockhash"}' , headers )
84+ conn .request ('POST ' , '/' , '{"method": "getbestblockhash"}' , headers )
8585 out1 = conn .getresponse ().read ();
8686 assert_equal ('"error":null' in out1 , True )
8787 assert_equal (conn .sock != None , False ) #connection must be closed because keep-alive was set to false
@@ -93,10 +93,10 @@ def run_test(self):
9393
9494 conn = httplib .HTTPConnection (urlNode2 .hostname , urlNode2 .port )
9595 conn .connect ()
96- conn .request ('GET ' , '/' , '{"method": "getbestblockhash"}' , headers )
96+ conn .request ('POST ' , '/' , '{"method": "getbestblockhash"}' , headers )
9797 out1 = conn .getresponse ().read ();
9898 assert_equal ('"error":null' in out1 , True )
99- assert_equal (conn .sock != None , False ) #connection must be closed because bitcoind should use keep-alive by default
99+ assert_equal (conn .sock != None , True ) #connection must be closed because bitcoind should use keep-alive by default
100100
101101if __name__ == '__main__' :
102102 HTTPBasicsTest ().main ()
0 commit comments