Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using WinHttp functions in my C++ code.
For server I want use url include extension.
C++
LPCWSTR server=L"www.arad.com/up/up.php";
hSession = WinHttpOpen(  L"A WinHTTP Example Program/1.0", 
		WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
		WINHTTP_NO_PROXY_NAME, 
		WINHTTP_NO_PROXY_BYPASS, 0);

	// Specify an HTTP server.
	if (hSession)
		hConnect = WinHttpConnect( hSession, server,
		INTERNET_DEFAULT_PORT, 0);

When I use this url: "www.arad.com/up/up.php" it gives error 12005 (Url Invalid) and accept "www.arad.com".
How I can add my url extension: "/up/up.php"

Regards,
Posted
Comments
enhzflep 13-Oct-13 16:17pm    
Haven't worked with WinInet myself, just raw sockets. Though I can't help but wonder if you've missunderstood seomthing along the way.

A server resides at an IP address, which thanks to DNS we can represent as a textual name.
A page resides in a folder on that server.

That is to say: I think your server should simply be www.arad.com - you then want to grab the up.php page, which is located in the /up directory.

You can't 'connect' to a page - you connect to a server and from there request the specific resource (page, image, sound, video) you're after. :)
pasztorpisti 13-Oct-13 18:02pm    
Here are the parts of an URL: URI scheme/Examples.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900