Execute URL from VS 2010
-
13 มิถุนายน 2555 13:19
Dear All,
I want execute an URL.
This URL used to send SMS.
here the URL:
http://Surbakti:surbaktiTest@sms.Surbakti.com:8080/api/single/?from=Surbakti&msisdn=2132324&message=Please+Open+Your+Email
I have Try with this:
Imports System.Net
Imports System.Net.WebClientDim request As HttpWebRequest
Dim response As HttpWebResponserequest = CType(WebRequest.Create(url), HttpWebRequest)
response = CType(request.GetResponse(), HttpWebResponse)I have try this one:
request = DirectCast(WebRequest.Create(url), HttpWebRequest)
response = DirectCast(request.GetResponse(), HttpWebResponse)with 2 method above, I got error: HTTP status 401: Unauthorized.
what the i miss?
how can i get send the sms from that link?
Help Me Please.
Thanks
Surbakti
ตอบทั้งหมด
-
13 มิถุนายน 2555 13:30
Hello Surbakti
That's not a URI which the HttpWebRequest can easily handle. It contains login information for the BasicAuth scheme. Before "executing" this url, delete this part: "Surbakti:surbaktiTest@" and use the user name "Surbakti" and the password "surbakti" to create new network credentials.
See also:
[1] http://msdn.microsoft.com/de-de/library/system.net.webrequest.aspx
[2] http://www.ie-soft.de/blog/PermaLink,guid,11609e8d-e0fc-41f4-83a2-6e8ea46339f6.aspx
Kind regards
Jonathan Best
