Solved

Delphi & Winsock & HTML

Posted on 1997-04-28
1
406 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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