Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Procedure sendPOST(server.s,path.s,post.s,agent.s = "sendPOST",port.w = 80,timeout.w = 5000)
- Protected header.s,conn.i
- conn = OpenNetworkConnection(server,port,#PB_Network_TCP,timeout)
- If conn
- header = "POST " + path + " HTTP/1.1" + #CRLF$
- header + "Host: " + server + #CRLF$
- header + "Connection: close" + #CRLF$
- header + "User-Agent: " + agent + #CRLF$
- header + "Content-Type: application/x-www-form-urlencoded;charset=utf-8" + #CRLF$
- header + "Content-Length: " + Str(StringByteLength(post,#PB_UTF8)) + #CRLF$
- header + #CRLF$
- Debug header
- SendNetworkString(conn,header+post+#CRLF$)
- CloseNetworkConnection(conn)
- ProcedureReturn #True
- EndIf
- ProcedureReturn #False
- EndProcedure
- InitNetwork()
- log.s = "что-то сделал|еще что-то сделал|и еще|test|как дела|коmbo"
- sendPOST("mydomain.com","/sendPOST.php","log="+log)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement