Solved

Delphi & Winsock & HTML

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
find a node in VST 2 68
Performance of SQL statement 37 111
When i run adoquery my application freezes 26 166
How to load 2 images in same column in Delphi 2 47
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

777 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