msglay problem

Discussions related to Visual Prolog
User avatar
Tonton Luc
VIP Member
Posts: 500
Joined: 16 Oct 2001 23:01

msglay problem

Unread post by Tonton Luc » 17 Sep 2015 7:44

Hi,

I don't understand why this cURL VP 7.3 clause works fine :

Code: Select all

                _ = Connection:curl_easy_setopt(cURLOPT_HTTPGET, i(1)),                 _ = Connection:curl_easy_setopt(cURLOPT_URL, s("http://www.largus.fr/fiche-technique.html\n\n")), % 1er mail                 _ = Connection:curl_easy_perform()
but this one return a bad respons :

Code: Select all

    Serveur = "www.largus.fr",   URL = format("http://%/fiche-technique.html\r\n",Serveur),     Req = format("GET % HTTP/1.1\r\nACCEPT */*\r\nHOST: %\r\n\r\n",URL,Serveur),     trap(SOCKET = msgSocketBlocking::msglay_Connect(Serveur, 80, []),_,(stdio::write("msglay_Connect : pas ok\n"),fail())),     msglay_WriteStr(SOCKET,Req),
Content-Type: text/html
Content-Length: 166
Accept-Ranges: bytes
Date: Thu, 17 Sep 2015 07:32:19 GMT
X-Varnish: 921139673
Age: 0
Via: 1.1 varnish
Connection: close
X-Cache: MISS

<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>
This one works fine too :

Code: Select all

    Serveur = "discuss.visual-prolog.com", URL = format("http://%\r\n",Serveur), % ok     Req = format("GET % HTTP/1.1\r\nACCEPT */*\r\nHOST: %\r\n\r\n",URL,Serveur),     trap(SOCKET = msgSocketBlocking::msglay_Connect(Serveur, 80, []),_,(stdio::write("msglay_Connect : pas ok\n"),fail())),     msglay_WriteStr(SOCKET,Req),
Any :idea:

Post Reply