Oleg Kobchenko wrote:
> This only works for a particular server,
> because they do not use
>   Transfer-Encoding: chunked
> 
> Most other HTTP/1.1 servers do. It requires
> complex stream handling to process "chunked"
> correctly: parsing header, which is readline;
> syncing TCP packets and chunks, etc.
> 

Is it really necessary to use HTTP/1.1? I usually use HTTP/1.0 (to avoid
chunked) and supply header to imitate a browser request.
eg.
req10=: 3 : 0
  'host port path'=. y
  t=.   'GET ',path,' HTTP/1.0',CRLF
  t=. t,'Accept: */*',CRLF
  t=. t,'Accept-Language: en-us',CRLF
  t=. t,'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; 
SV1)',CRLF
  t=. t,'Host: ',host,CRLF
  t=. t,'Connection: Keep-Alive',CRLF
  t=. t,CRLF
  t
)

Sometimes server check referer to stop hot-link, so that it need to add
  t=. t,'Referer: ',referer,CRLF

where referer is the webpage contain the link to the requested resource.


-- 
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to