<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[HTTP Client]]></title><description><![CDATA[<p>Hi habe gerade probiert ein simples Programm (als Einstieg) zu schreiben das sich über das HTTP Protokoll mit einem InternetServer verbindet und sich wieder beendet. Obwohl es einen Fehler in der HttpSendRequest() Funktion verwendet, habe ich es auf einer Seite mit einem Counter ausprobiert und es hat wie erwartet keine Wirkung gezeigt. Der Fehler der HttpSendRequest() Funktion, mittels GetLasError() ermittelt ist 997, allerdings kann ich mit der Beschreibung des Fehlers in der MSDN nicht mein Problem beheben. Hier ist der Code.</p>
<pre><code class="language-cpp">DWORD cont = 5, contt = 6;

HINTERNET hInt = InternetOpen(&quot;Besucher&quot;, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL,
                              INTERNET_FLAG_ASYNC);
if(hInt == NULL) cout&lt;&lt;&quot;InternetOpen() fehlgeschlagen.&quot;&lt;&lt;endl;

HINTERNET hCon = InternetConnect(hInt, &quot;www.google.de&quot;,
                                 INTERNET_DEFAULT_HTTP_PORT, NULL, NULL,
                                 INTERNET_SERVICE_HTTP,
                                 INTERNET_FLAG_NO_COOKIES, cont);
if(hCon == NULL) cout&lt;&lt;&quot;InternetConnect() fehlgeschlagen.&quot;&lt;&lt;endl;

HINTERNET hHttp = HttpOpenRequest(hCon, NULL, NULL, NULL, NULL, NULL, NULL,
                                  contt);
if(hHttp == NULL) cout&lt;&lt;&quot;HttpOpenRequest() fehlgeschlagen.&quot;&lt;&lt;endl;

bool hSend = HttpSendRequest(hHttp, NULL, NULL, NULL, 0);
if(!hSend) cout&lt;&lt;&quot;HttpSendRequest() fehlgeschlagen.&quot;&lt;&lt;endl;
cout&lt;&lt;GetLastError()&lt;&lt;endl;

InternetCloseHandle(hCon);
InternetCloseHandle(hInt);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/150278/http-client</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Jul 2026 11:15:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/150278.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Jun 2006 17:23:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to HTTP Client on Wed, 14 Jun 2006 17:23:48 GMT]]></title><description><![CDATA[<p>Hi habe gerade probiert ein simples Programm (als Einstieg) zu schreiben das sich über das HTTP Protokoll mit einem InternetServer verbindet und sich wieder beendet. Obwohl es einen Fehler in der HttpSendRequest() Funktion verwendet, habe ich es auf einer Seite mit einem Counter ausprobiert und es hat wie erwartet keine Wirkung gezeigt. Der Fehler der HttpSendRequest() Funktion, mittels GetLasError() ermittelt ist 997, allerdings kann ich mit der Beschreibung des Fehlers in der MSDN nicht mein Problem beheben. Hier ist der Code.</p>
<pre><code class="language-cpp">DWORD cont = 5, contt = 6;

HINTERNET hInt = InternetOpen(&quot;Besucher&quot;, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL,
                              INTERNET_FLAG_ASYNC);
if(hInt == NULL) cout&lt;&lt;&quot;InternetOpen() fehlgeschlagen.&quot;&lt;&lt;endl;

HINTERNET hCon = InternetConnect(hInt, &quot;www.google.de&quot;,
                                 INTERNET_DEFAULT_HTTP_PORT, NULL, NULL,
                                 INTERNET_SERVICE_HTTP,
                                 INTERNET_FLAG_NO_COOKIES, cont);
if(hCon == NULL) cout&lt;&lt;&quot;InternetConnect() fehlgeschlagen.&quot;&lt;&lt;endl;

HINTERNET hHttp = HttpOpenRequest(hCon, NULL, NULL, NULL, NULL, NULL, NULL,
                                  contt);
if(hHttp == NULL) cout&lt;&lt;&quot;HttpOpenRequest() fehlgeschlagen.&quot;&lt;&lt;endl;

bool hSend = HttpSendRequest(hHttp, NULL, NULL, NULL, 0);
if(!hSend) cout&lt;&lt;&quot;HttpSendRequest() fehlgeschlagen.&quot;&lt;&lt;endl;
cout&lt;&lt;GetLastError()&lt;&lt;endl;

InternetCloseHandle(hCon);
InternetCloseHandle(hInt);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1077801</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1077801</guid><dc:creator><![CDATA[PsychoticStyx]]></dc:creator><pubDate>Wed, 14 Jun 2006 17:23:48 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Client on Wed, 14 Jun 2006 18:02:51 GMT]]></title><description><![CDATA[<p>Du hast ja auch eine asynchrone Session erstellt. Fehlercode 997 ist nix anderes als &quot;Overlapped I/O operation is in progress.&quot;, also verläuft alles ordnungsgemäß. Du mußt entweder irgendwo eine Callback funktion angeben oder du lässt halt das INTERNET_FLAG_ASYNC Flag bei InternetOpen() weg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1077817</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1077817</guid><dc:creator><![CDATA[Ranner]]></dc:creator><pubDate>Wed, 14 Jun 2006 18:02:51 GMT</pubDate></item><item><title><![CDATA[Reply to HTTP Client on Wed, 14 Jun 2006 18:10:49 GMT]]></title><description><![CDATA[<p>danke funktioniert jetzt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1077823</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1077823</guid><dc:creator><![CDATA[PsychoticStyx]]></dc:creator><pubDate>Wed, 14 Jun 2006 18:10:49 GMT</pubDate></item></channel></rss>