What goes into Response.Body? - WeOnlyDo Discussion board

What goes into Response.Body? (General questions)

by Skc, Friday, November 30, 2007, 13:19 (6203 days ago)

I use a series of wodhttp1.Request.Formpost.add and then 'post' the data via a .asp program on the server. The .asp program would do a Response.Write '0' or Response.Write '1' depending on whether it was a success or not.

I use wodhttp1.Response.Body to retrieve this '0' or '1'. Response.body does show the '0' or '1'. However I found that after the expected '0' or '1' there were additional chunks of the .asp program codes returned with it. Is there any reason why the extra program codes are returned?

Re: What goes into Response.Body?

by woddrazen, Friday, November 30, 2007, 13:49 (6203 days ago) @ Skc

Hi Skc,


wodHttpDLX Response Body Property holds response body from server. This is response body that you should receive when you request something from your http or https server.

Here is simple example which will explain how to use Response Body Property.

[code]Set http1 = New wodHttpDLXCom

http1.Blocking = True
http1.Get http://www.google.com
Debug.Print http1.Response.Body[/code]

More help you can find here:
http://www.weonlydo.com/HttpDLX/Help/wodHttpDLXLib~HttpResponse~Body.html

Hope I helped.


Regards,
Drazen

Re: What goes into Response.Body?

by Skc, Friday, November 30, 2007, 16:07 (6203 days ago) @ woddrazen

IS the example you gave complete? I am getting an error:

Error occured while accessing component property/method GET.
The current connection has been aborted by the network or intermediate services.
10053 - The current connection has been aborted.

Tried hostname = www.weonlydo.com - same error. What is the expected response.body if it were working?

Back to my original question - the .asp program is coded in VBScript - am I right to say that all Response.Write text would be passed to Response.body? Would you know whether there is any other VBScript command that would also send its output to Response.Body?

Re: What goes into Response.Body?

by wodDamir, Friday, November 30, 2007, 16:21 (6203 days ago) @ Skc

HI Skc,

Yes, the code that Drazen gave you is complete. As the output you should receive the page source. Same as if you set Http1.Response.Filename = C:out.htm , or if you opened www.weonlydo.com in IE, and selected View source .

As for the error, do you perhaps have any firewalls runnging? Can you please try disabling them?

Also, did you try our samples which came with the component? We do have a VBS sample included into the installation package.

Regards,
Damba

Re: What goes into Response.Body?

by SKc, Saturday, December 01, 2007, 05:18 (6202 days ago) @ wodDamir

I disabled Norton Internet Security - still does not work - I am creating a new post for this.

Back to what goes into response.body. From your explanation, GET may return the HTML source codes. When calling a .asp program, is there a way to get hold of the text return by Response.Write only? I don't want to retrieve the HTML codes.

Re: What goes into Response.Body?

by SKc, Saturday, December 01, 2007, 09:19 (6202 days ago) @ SKc

I have just done some read-up. It appears that a wodHTTP.GET will get the whole HTML page. However if there are codes between < ... > then these codes will be hidden and therefore will not be returned to wodHTTP.GET unless there is an explicit Response.write inside. So wodHTTP.Response.Body should have both HTML codes and any text explicitly written out by .asp Response.write .

The problem I had is the way my colleague's .asp page was written. I have answered myself. Thank you.