Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

HTTP GET/POST

Posted on 2008-06-20
4
286 Views
Last Modified: 2013-11-26
I need to code a http post to request something from a remote server and receive a response. I simply want to integrate sms functioality into my website. I have an account set up with the company at the following website and all I want to do is plug into their sms functionality.

This is the website
http://www.smsglobal.com.au/api/http.html
Can anyone give me some clues on where to start? I am developing using VB and visual Studio 2008,

I just want an ascx and aspx that would connect to the above service.

0
Comment
Question by:JOHNFROG
  • 3
4 Comments
 
LVL 2

Expert Comment

by:balochdude
ID: 21832001
Use WebRequest or WebResponse.

      Dim objWebRequest As WebRequest = WebRequest.Create(strURL)
      Dim objWebResponse As WebResponse = objWebRequest.GetResponse()
      Dim objStream As Stream = objWebResponse.GetResponseStream()
      Dim objStreamReader As StreamReader = New StreamReader(objStream)
      Dim strHTML As String = objStreamReader.ReadToEnd
0
 
LVL 2

Expert Comment

by:balochdude
ID: 21832029
Use WebRequest AND WebResponse

-- OR --

Use HTTPWebRequest
0
 
LVL 2

Accepted Solution

by:
balochdude earned 500 total points
ID: 21832109
HTTPWebRequest Example:

Its not the complete code but it will give you some idea (and its not tested code):

Dim smsRequest as HttpWebRequest = WebRequest.Create("http://www.smsglobal.com.au.http-api.php?action=ACTION&user=USERNAME&
password=SECRET&from=FROMNUMBER&to=61409317436&text=Hello%20world");
smsRequest.Method = "POST"
smsRequest.ContentType="application/x-www-form-urlencoded"
Dim st as Stream = smsRequest.GetRequestStream()
' Send data with st and close st
0
 

Author Comment

by:JOHNFROG
ID: 21836231
Nice one. Actually I took that and then found
http://www.asp101.com/samples/http_post_aspx.asp which I would thoroughly recommend to anyone foloowing the solution.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question