Advertisement
deseven

sendPOST

May 5th, 2015
888
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Procedure sendPOST(server.s,path.s,post.s,agent.s = "sendPOST",port.w = 80,timeout.w = 5000)
  2.   Protected header.s,conn.i
  3.   conn = OpenNetworkConnection(server,port,#PB_Network_TCP,timeout)
  4.   If conn
  5.     header = "POST " + path + " HTTP/1.1" + #CRLF$
  6.     header + "Host: " + server + #CRLF$
  7.     header + "Connection: close" + #CRLF$
  8.     header + "User-Agent: " + agent + #CRLF$
  9.     header + "Content-Type: application/x-www-form-urlencoded;charset=utf-8" + #CRLF$
  10.     header + "Content-Length: " + Str(StringByteLength(post,#PB_UTF8)) + #CRLF$
  11.     header + #CRLF$
  12.     Debug header
  13.     SendNetworkString(conn,header+post+#CRLF$)
  14.     CloseNetworkConnection(conn)
  15.     ProcedureReturn #True
  16.   EndIf
  17.   ProcedureReturn #False
  18. EndProcedure
  19.  
  20. InitNetwork()
  21. log.s = "что-то сделал|еще что-то сделал|и еще|test|как дела|коmbo"
  22. sendPOST("mydomain.com","/sendPOST.php","log="+log)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement