Solved

Delphi & Winsock & HTML

Posted on 1997-04-28
1
392 Views
Last Modified: 2010-04-04
I try to make a sort of web browser, but I have the following problem: The token

HEAD /index.html

is not accepted by all servers. I'm sure the file is on the
server, but the program tells me "Bad request". Why ?
What is my mistake ?

Also, can somebody show me a little example for
WSAAsyncgethostbyname ?
I'm interested in using this command to prepare the
parameters for the connect() instruction.

Thanks in advance.
0
Comment
Question by:dante042897
1 Comment
 
LVL 2

Accepted Solution

by:
alona041797 earned 100 total points
ID: 1335759
First, the HTTP command you should use is:

  HEAD / HTTP/1.1
  (add more headers here such as Accept)

If you get a response starting with "5", the sever does not suppourt HTTP/1.1 use HTTP/1.0 or HTTP/0.9 instead.

  GET / HTTP/1.0
  (add more headers here such as Accept)

  or

  GET /

In regard to using WinSock, why not use one of the freeware components from the DSP (I suggest socks and/or wsock100):

http://sunsite.icm.edu.pl/delphi/

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now