Re: CommStreams
Posted: Mon Nov 19, 2018 7:31 am
I'm pleased to hear that - but Ivan deserves the credit for the programDGDanforth wrote:I ran Chris' program and it worked!
The board for BlackBox users and developers
https://community.blackboxframework.org/
I'm pleased to hear that - but Ivan deserves the credit for the programDGDanforth wrote:I ran Chris' program and it worked!
Code: Select all
(s: Stream) ReadBytes (VAR x: ARRAY OF BYTE; beg, len: INTEGER; OUT read: INTEGER), NEW, ABSTRACT;
Code: Select all
s.ReadBytes(x, 0, len, read);
Code: Select all
CONST len = 1024;
I don't see your program on this thread.Josef Templ wrote:If there are any problems with downloading, it may be required to look into the responses
provided by the http server directly. I don't know if this is possible with Ivan's program.
If it is not possible you can use the sample program I have posted earlier in this topic.
I am not to that point yet. I can not see any data from the website.Josef Templ wrote:it shows the response header and the body in a text view.
Replacing the URL related info should be obvious, but note that there are several places.
As Ivan pointed out before, you need to know the HTTP 1.1 standard or at least HTTP 1.0
in order to fully understand the meaning of the many optional and/or mandatory parameters passed
in a http request and response header. This can be challenging, very challenging.
Code: Select all
stream.Send("GET /" + par$ + " HTTP/1.1" + 0DX + 0AX + "Host: " + host$ + 0DX + 0AX + 0DX + 0AX);
Code: Select all
request := "GET http://greenwoodfarm.com:80/ HTTP/1.0" + CRLF
+ "Host: greenwoodfarm.com" + CRLF
+ CRLF;
My example supports redirects and chunked answers. Also support callbacks, what to do with downloaded data. There is no full support for HTTP 1.1 and no support for SSL, however for most simple cases it is usefulJosef Templ wrote:If there are any problems with downloading, it may be required to look into the responses
provided by the http server directly. I don't know if this is possible with Ivan's program.
Ivan Denisov wrote:My example supports redirects and chunked answers. Also support callbacks, what to do with downloaded data. There is no full support for HTTP 1.1 and no support for SSL, however for most simple cases it is usefulJosef Templ wrote:If there are any problems with downloading, it may be required to look into the responses
provided by the http server directly. I don't know if this is possible with Ivan's program.
Code: Select all
MODULE TestDownLoadAndOpen;
IMPORT
CommHttp;
PROCEDURE DownLoadAndOpen (url: ARRAY OF CHAR);
VAR d: CommHttp.Dowing;
BEGIN
d := CommHttp.NewDownLoad(url);
d.onFinish := OpenAsText;
(* d.silent := TRUE; (* to hide log view *) *)
d.Start;
END DownLoadAndOpen;
END TestDownLoadAndOpen.
"CommObxHttp.DownLoadAndOpen('http://google.com')"
Ivan Denisov wrote: I got Josef's example to work viewtopic.php?f=32&t=208#p1370
This modules I packed hereDGDanforth wrote: There is no module called
CommHttp
OR
CommObxHttp