Click here to Skip to main content
15,895,667 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionVB identification of web page links Pin
Snoot_5435332-Apr-06 3:39
Snoot_5435332-Apr-06 3:39 
Questionhow to update the database with windows service Pin
jillamadhu2-Apr-06 2:33
jillamadhu2-Apr-06 2:33 
Questionhow to update the database with windows service Pin
jillamadhu2-Apr-06 2:30
jillamadhu2-Apr-06 2:30 
QuestionHow to retrieve value for each items in combobox?? Pin
besah1-Apr-06 16:25
besah1-Apr-06 16:25 
AnswerRe: How to retrieve value for each items in combobox?? Pin
Steve Pullan1-Apr-06 22:23
Steve Pullan1-Apr-06 22:23 
AnswerRe: How to retrieve value for each items in combobox?? Pin
jcrussell2-Apr-06 18:55
jcrussell2-Apr-06 18:55 
QuestionDatagrid header from CSV file. Pin
japel1-Apr-06 13:43
japel1-Apr-06 13:43 
QuestionHttpWebRequest - 400 Bad Request Pin
benblanco1-Apr-06 11:26
benblanco1-Apr-06 11:26 
I'm trying to use a HttpWebRequest to login to a Breeze server. I've tried a WebClient also. I keep getting a '400 bad request' reponse from the server.

This URL works fine through a browser:
http://admin.breezecentral.com/api/xml?action=login&login=jon@doe.com&password=foobar

Its a test server so go ahead. Play with it.

Here is my code:
Dim encoding As New System.Text.UTF8Encoding
Dim PostData As String = "action=login&login=jon@doe.com&password=foobar"
Dim Data() As Byte = encoding.GetBytes(PostData)
Dim LoginReq As Net.HttpWebRequest = Net.WebRequest.Create("http://admin.breezecentral.com/api/xml")
Dim CookieC As New Net.CookieContainer

With LoginReq
.KeepAlive = False
.Method = "POST"
.ContentType = "application/x-www-form-urlencoded"
.ContentLength = Data.Length
.CookieContainer = CookieC
End With

Dim SendReq As IO.Stream = LoginReq.GetRequestStream
SendReq.Write(Data, 0, Data.Length)
SendReq.Close()

Dim LoginRes As Net.HttpWebResponse = LoginReq.GetResponse()
CookieC.Add(LoginRes.Cookies)

Dim sReader As IO.StreamReader = New IO.StreamReader(LoginRes.GetResponseStream)
Dim HTML As String = sReader.ReadToEnd
Debug.Write(HTML)

Please help. I'm sure I have some small setting wrong.
AnswerRe: HttpWebRequest - 400 Bad Request Pin
benblanco3-Apr-06 7:53
benblanco3-Apr-06 7:53 
QuestionHow to Play Audio and video songs in vb.net Pin
Kiran Indira1-Apr-06 6:37
Kiran Indira1-Apr-06 6:37 
AnswerRe: How to Play Audio and video songs in vb.net Pin
Qendro7-Sep-08 2:56
Qendro7-Sep-08 2:56 
Questiondeploymenet Pin
SVb.net1-Apr-06 2:25
SVb.net1-Apr-06 2:25 
Questionuesr control in vb.net Pin
prashantvashisht1-Apr-06 2:06
prashantvashisht1-Apr-06 2:06 
QuestionFormatting a Data Grid. Pin
daviiie1-Apr-06 2:06
daviiie1-Apr-06 2:06 
Questionhow to Refresh databse?? Pin
campbells1-Apr-06 1:53
campbells1-Apr-06 1:53 
AnswerRe: how to Refresh databse?? Pin
riptide792-Apr-06 6:08
riptide792-Apr-06 6:08 
GeneralRe: how to Refresh databse?? Pin
campbells3-Apr-06 2:22
campbells3-Apr-06 2:22 
QuestionFinding a Excel.exe file in drives Pin
lirthick1-Apr-06 1:35
lirthick1-Apr-06 1:35 
AnswerRe: Finding a Excel.exe file in drives Pin
Garner T2-Apr-06 14:04
Garner T2-Apr-06 14:04 
Questionhow to connect VB.Net webform with mysql Pin
Amit Agarrwal31-Mar-06 23:57
Amit Agarrwal31-Mar-06 23:57 
Questionvb.net & database Pin
dash_ashu31-Mar-06 21:40
dash_ashu31-Mar-06 21:40 
AnswerRe: vb.net & database Pin
SVb.net1-Apr-06 2:30
SVb.net1-Apr-06 2:30 
GeneralRe: vb.net & database Pin
dash_ashu2-Apr-06 19:36
dash_ashu2-Apr-06 19:36 
QuestionCrystal Reports and VB6 Pin
Vikrant Badhai31-Mar-06 20:55
Vikrant Badhai31-Mar-06 20:55 
Questionbuilt ruler vb.net Pin
sami200531-Mar-06 20:27
sami200531-Mar-06 20:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.