A amarnath Member Licensed User Longtime User May 9, 2017 #1 VB API with Sample Code Dim strUrl As String Dim strResp As String strUrl = http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=Username: Password&senderID=mVaayoo&receipientno= 919849558211&msgtxt=This is a test from mVaayoo API&state=4 strResp = DoWebRequest(strUrl) End Sub 'Do web Request Function Public Function DoWebRequest(url) As String On Error GoTo err_DoWebRequest Dim objXML As Object Set objXML = CreateObject("Microsoft.XMLHTTP") objXML.Open "GET", url, False objXML.Send If (objXML.Status = 404) Then DoWebRequest = "404 Error" Else DoWebRequest = objXML.ResponseText End If Set objXML = Nothing Exit Function err_DoWebRequest: DoWebRequest = "ERROR" Exit Function End Function
VB API with Sample Code Dim strUrl As String Dim strResp As String strUrl = http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=Username: Password&senderID=mVaayoo&receipientno= 919849558211&msgtxt=This is a test from mVaayoo API&state=4 strResp = DoWebRequest(strUrl) End Sub 'Do web Request Function Public Function DoWebRequest(url) As String On Error GoTo err_DoWebRequest Dim objXML As Object Set objXML = CreateObject("Microsoft.XMLHTTP") objXML.Open "GET", url, False objXML.Send If (objXML.Status = 404) Then DoWebRequest = "404 Error" Else DoWebRequest = objXML.ResponseText End If Set objXML = Nothing Exit Function err_DoWebRequest: DoWebRequest = "ERROR" Exit Function End Function
DonManfred Expert Licensed User Longtime User May 9, 2017 #2 Use code tags when posting code. See okhttputils2. okHttputils2 is the way to go. Search the forum about httpob samples or other questions. For example this turtorial https://www.b4x.com/android/forum/threads/httputils2-web-services-are-now-even-simpler.18992/ Upvote 0
Use code tags when posting code. See okhttputils2. okHttputils2 is the way to go. Search the forum about httpob samples or other questions. For example this turtorial https://www.b4x.com/android/forum/threads/httputils2-web-services-are-now-even-simpler.18992/