Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Send SMS Message URL XML HTTP Request
I would like to handle this with WinBatch, not showing a browser, and receive a return message. Can you help me?
;------------------------------------------------------------------------------------------------------------------------------------------ #DefineFunction udfURLDownloadToString (strURL) objXML = ObjectCreate ("Microsoft.XMLHTTP") objXML.Open("GET", strURL, @FALSE) intEMLast = ErrorMode (@OFF) objXML.send() ErrorMode (@CANCEL) intLastError = LastError () ErrorMode (intEMLast) strText = "" If intLastError == 0 Then strText = objXML.responseText objXML = 0 Return strText #EndFunction ;------------------------------------------------------------------------------------------------------------------------------------------ strURL = "http://www.host.com/send.php?request=send&USERNAME=john&PASSWORD=doe&DESTINATION=012345678&SENDER=me&BODY=this is a message" strResult = udfURLDownloadToString (strURL) ; 200 OK ; Standard response for successful HTTP requests. The actual response will depend on the request method used. ; In a GET request, the response will contain an entity corresponding to the requested resource. ; In a POST request the response will contain an entity describing or containing the result of the action. :CANCEL Exit
host = 'www.host.com' path = 'send.php?request=send&USERNAME=john&PASSWORD=doe&DESTINATION=012345678&SENDER=me&BODY=this is a message' AddExtender("WWINT44I.DLL") tophandle=iBegin(0,"","") connecthandle=iHostConnect(tophandle, host,@HTTP,"", "") datahandle=iHttpInit(connecthandle, "GET", path, "",0) If datahandle==0 err=iGetLastError() Message("Last Error",err) iClose(tophandle) Exit EndIf ;Make sure to allocate large enough buffer to hold the entire file size=10000 buf=BinaryAlloc(size) ;Get address of buffer bufaddr=IntControl (42, buf, 0, 0, 0) BinaryEodSet(buf, size) rslt=iHttpOpen(datahandle, "", 0,0) If rslt=="ERROR" || rslt!=200 If rslt == "ERROR" errstr = "WinInet Error" rslt = iGetLastError() Else errstr = "HTTP Error" EndIf Message(errstr,rslt) iClose(tophandle) Exit EndIf xx=iReadDataBuf(datahandle,bufaddr,size) Message('bytes read',xx) str=BinaryPeekStr(buf, 0, size) Message("Contents of Buffer",str) iClose(datahandle) iClose(tophandle) Message("All","Done") Exit
Article ID: W18492
Filename: Send SMS Messages.txt
File Created: 2011:01:20:13:32:46
Last Updated: 2011:01:20:13:32:46