Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTTP persistent connection
#6
Slower. Every time about 400 ms. QM - first time 400 ms then 190.

GET example
Macro
Code:
Copy      Help
out
typelib CSHttpClientLib {12CB8C40-6A6B-11D0-A74C-444553540000} 1.0
CSHttpClientLib.CSHttpClient c._create
c.RequestURL="http://www.google.com"
c.Execute("GET")
out c.ResponseBody(0)

POST example
Macro
Code:
Copy      Help
out
typelib CSHttpClientLib {12CB8C40-6A6B-11D0-A74C-444553540000} 1.0
CSHttpClientLib.CSHttpClient c._create
c.RequestURL="http://www.quickmacros.com/form2.php"
str s="a=b&c=d"
VARIANT v=s
c.RequestBody=v
c.RequestHeaders=_s.format("Content-Type: application/x-www-form-urlencoded[]Content-Length: %i[]Cache-Control: no-cache[]" s.len)
rep 5
,int t1=timeGetTime
,c.Execute("POST")
,out timeGetTime-t1
,out c.ResponseBody(0)

Don't know how to set password. Maybe in URL, but did not test.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)