0

I just started to play a bit around with cURLpp, and try to read a XML document from the web. Here is the site:

https://www.westlotto.com/wlinfo/WL_InfoService?gruppe=SpielplanToto

When I do a simple cURLpp operation:

try {
    curlpp::Cleanup myCleanup;
    curlpp::Easy myRequest;
    myRequest.setOpt<Url>("http://www.westlotto.com/wlinfo/WL_InfoService?gruppe=SpielplanToto");
    myRequest.perform();
}
catch(curlpp::RuntimeError & e) {
    ...
}

I get this document:

<html>
<title>Request Denied!</title>
<body><center><h1>Request Denied!</h1>
<p>www.westlotto.de</p>
<p>If you have any questions contact the admin.</p>
</center></body>
</html>

With the curl command line tool, it works fine. I have no idea what is going on and how to solve this.

Thanks!

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Da Li
  • 189
  • 1
  • 9
  • Did you examine the network traffic with Wireshark and see the difference between what a browser sends and what you are sending? The problem is likely a missing `user-agent` header or one that the server disallows. – Jim Garrison Aug 30 '17 at 15:57
  • cURLpp is just a C++ wrapper for the C libcurl library, which is the same library that the `curl` command line tool uses internally. So simply translate the command-line parameters you are using into cURLcc equivalent parameters, per the libcurl and cURLpp documentations. If you can't figure it out, show the actual command line you are using and someone will be able to translate it for you. – Remy Lebeau Aug 30 '17 at 16:32
  • the commandline is curl https://www.westlotto.com/wlinfo/WL_InfoService?gruppe=SpielplanToto No flags at all - Any hints? – Da Li Aug 30 '17 at 22:33

0 Answers0