there is no standard for returning errors other than the status description.
you may need to read the response content (response.GetResponseStream) to get
detail.
-- bruce (sqlwork.com)
On 19 Dez., 18:13, bruce barker
<brucebar...@discussions.microsoft.com> wrote:
> there is no standard for returning errors other than the status description.
> you may need to read the response content (response.GetResponseStream) to get
[quoted text clipped - 43 lines]
>
> > Dirk
As far as I read i can use
Dim response As HttpWebResponse = request.GetResponse()
Dim responseStream As Stream = response.GetResponseStream
Dim reader As StreamReader = New
StreamReader(responseStream)
but vb.net throw an error just after the first line (Dim response As
HttpWebResponse = request.GetResponse()) as the server send bacxk an
400 status code. The next line of code doen't get executed anymore.
Dirk
and then
bruce barker - 19 Dec 2007 21:18 GMT
dim response before the try, then you can access it in the catch. be sure to
check that it is not null which it will be if there is a connection error
rather than a bad response code.
-- bruce (sqlwork.com)
> On 19 Dez., 18:13, bruce barker
> <brucebar...@discussions.microsoft.com> wrote:
[quoted text clipped - 59 lines]
> Dirk
> and then
Dirk.Reimers - 20 Dec 2007 07:17 GMT
Hi,
here are some server communication sniffs:
everythink ok:
---
GET /TVBrowserTimerEvent?command=add
HTTP/1.1
Authorization: Basic cm9vdDpkcmVhbWJveA==
HTTP/1.1 200 OK
Connection: close
Content-Length: 37
Content-Type: text/html; charset=utf-8
event was created successfully.
----
and now the error state:
---
GET /TVBrowserTimerEvent?command=add
HTTP/1.1
Authorization: Basic cm9vdDpkcmVhbWJveA==
HTTP/1.1 400 Function failed.
Connection: close
Content-Length: 97
Content-Type: text/html; charset=utf-8
event could not be added
---
in the error case 'request' is 'Nothing' indeed and the catch can
only access the ex error.The error description mentions server code
400. So I think the communiction is quite ok (I can see a valid HTTP
connection in the ehternet sniff) and the error is not a connetcion
error code. But I am not able to get any further descrition to be
parsed as there are some different errors with the same HTTP error
code.
Thanks for you support.
Dirk