Solved

HTTP GET/POST

Posted on 2008-06-20
4
280 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
Comment Utility
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
Comment Utility
Use WebRequest AND WebResponse

-- OR --

Use HTTPWebRequest
0
 
LVL 2

Accepted Solution

by:
balochdude earned 500 total points
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now