Speed up http post request #19409
Replies: 3 comments 8 replies
-
Are you on Windows? There are so many things in Windows that can slow you down... anti-virus, Windows Defender, etc., etc. Since you didn't supply your server code, there is no way for anyone else to test, but I would be willing to bet it takes milliseconds or less on Linux for the same code... |
Beta Was this translation helpful? Give feedback.
-
Also it would be good to see how you are running it, is compilation included in that time? |
Beta Was this translation helpful? Give feedback.
-
update using benchmark.
the results are. starting.. SPENT 0.009 ms in print header real 0m36.109s |
Beta Was this translation helpful? Give feedback.
-
My net.http code is taking 41 seconds to get reply. Here is the code below.What could be wrong?
import net.http
fn main(){
println("starting..")
posturl := "http://127.0.0.1:2222/billing/user_signin/"
post := '{"servedMSISDN": "2534444444","password": "dffdf4f7dd21d2293bd2d8500c507ad2c0414a156c6ea6f1d144bdc50cf244b82"}'
h:= http.new_header_from_map({http.CommonHeader.content_type:'application/json'})
println(h)
conf :=http.FetchConfig{
method:.post
url:posturl,
header:h,
data:post
user_agent:'volley-http'
}
resp := http.fetch(conf) !
println(resp.body)
}
Beta Was this translation helpful? Give feedback.
All reactions