Deepak Adhikari | 30 Apr 2013 19:58
Picon
Gravatar

[curlpp:227] http error codes

i want to download a file using http

the attached code works fine.

but the code is not usable when
-> the file is missing in the server
-> or if proper permission is not given to access the file
even if the file is missing or with no proper permission...the error code says CURL_OK ie no error.
the file still gets downloaded, and in it there is html page of apache 404 error or 403 error

i googled for many times but could not come up with any solutions
anyone could could please help me with these queries
-> how to stop redirect?
-> how to first check the http status codes? and if its 200 then only download file or else display proper message to user?
-> what are the basics test i need to perform before and after downloading of file? (so that the file gets downloaded successfully)


could anyone please help me
with regards,
deepak

--
You received this message because you are subscribed to the Google Groups "curlpp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to curlpp+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to curlpp-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/curlpp?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Attachment (curl0.cpp): text/x-c++src, 1808 bytes
nvangogh | 17 Mar 2013 20:34
Picon

[curlpp:225] Using my code to set the url option?

Hello,

In the examples the url option always seems to be hard coded into the programs. I am seeking to set the url option depending upon selections made by the user at the command line. This is probably easily done, but I am new to using libcurl and curlpp and cannot figure out how to do it. So for example:

#include <iostream>
#include <string>
#include <curlpp/cURLpp.hpp>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>

int main()
{
  // code selection of a url
  cURLpp::Cleanup mycleanup;
  int option;
  curlpp::options::Url myurl;
  std::cout << "Input option '1' for uk or option '2' for us \n";
  std::cin >> option;
  switch(option)
    {
    case 1:
      std::cout << "Option 1 selected...\n";
      myurl = "http://www.uk.co.uk";
      break;
    case 2:
      std::cout << "Option 2 selected...\n";
      myurl = "http://www.us.com";
      break;
    }
  
  
  return 0;
}

This code does not compile but i am trying to achieve something similar to this with my code. 

As an alternative to help explain my problem, consider this:

curlpp::options::Url myurl(std::string("https://www.google.com"));

Now if that was the url i wanted to use all the time - that would be fine. But depending upon selection of an option in my code, i might want to set the target url to "http:www.lycos.com" or perhaps "http://www.yahoo.com". In other words, the target url only becomes known at runtime and is dependant upon a user selection at the command line.

From what I can understand, the documentation appears to say that url takes the following argument (const char *link) - so can what i seek be achieved with a pointer or reference to a string? I would appreciate a snippet of code if you are able to help with this.
 
thanks

--
You received this message because you are subscribed to the Google Groups "curlpp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to curlpp+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to curlpp-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at http://groups.google.com/group/curlpp?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Daniel Smith | 10 Jan 2013 23:45
Picon

[curlpp:224] curlinfo_primary_ip

Hi. I'd like to know if there is any way to obtain this with curlpp. Thanks.

--
You received this message because you are subscribed to the Google Groups "curlpp" group.
To view this discussion on the web visit https://groups.google.com/d/msg/curlpp/-/soYxswbdtQkJ.
To post to this group, send email to curlpp-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to curlpp+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at http://groups.google.com/group/curlpp?hl=en.
curlppnoob | 26 May 2012 20:43

[curlpp:223] Curl check before download and Multithreading Question

Hello Curl Community,

i'm building a webcrawler, now i need to tune, my crawler, the crawler was build in php, but i have some problems.

Is this in Cpp possible:

e.g. I make a request to http://domain.com/4/dir/somepdf.pdf

When my crawler makes a request to that url, and the header returns, a for example application/pdf ,  than I want, that curl does not download the file (in one request). (I just want only text/html to download). In php i could do this in two requests like just receive the header, check, if ok than make a new request. I want todo this in one request check, stop or go.
The same applies to 404, 403, 503 HTTP errors i dont want fetch the body if the header returns a these errors.

Real Multi-threading, on PHP you dont have a real multi-threading, curl is so fast as your slowest request. Is this in Cpp possible to make a real multi threaded application?

As you can see im coming from PHP, does the cpp client has some other feat, which the php not has? which are worth to mention?

Thanks for help








--
You received this message because you are subscribed to the Google Groups "curlpp" group.
To view this discussion on the web visit https://groups.google.com/d/msg/curlpp/-/KNI7yTu0qbcJ.
To post to this group, send email to curlpp-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to curlpp+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/curlpp?hl=en.
khaled zayed | 25 Apr 2012 14:38
Picon

[curlpp:222] Cancel Current Transfer

Dear All,

I am using Curlpp tp fetch some Data using HTTP requests. Is there any
way to Cancel HTTP transfer using Curlpp. I used the progress function
to Cancel the current transfer by returning "1" instead of "0". But
sadly after canceling the transfer the whole program aborted. Moreover
I used Timeout and I faced the same problem. Is there any other method
that cancels the transfer without aborting the whole program

Best regards,
Khaled

--

-- 
You received this message because you are subscribed to the Google Groups "curlpp" group.
To post to this group, send email to curlpp@...
To unsubscribe from this group, send email to curlpp+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/curlpp?hl=en.

khaled zayed | 8 Mar 2012 15:32
Picon

[curlpp:221] ProgressFucntion

I am using Curlpp to fetch some segments. How can I use the Progress
Function

--

-- 
You received this message because you are subscribed to the Google Groups "curlpp" group.
To post to this group, send email to curlpp@...
To unsubscribe from this group, send email to curlpp+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/curlpp?hl=en.

sean | 30 Nov 2011 07:11
Picon

[curlpp:216] Trouble building cURLpp with SSL support

Hi!

I am pretty pumped up to get to work with cURLpp, but I am having
trouble building it with SSL support.  I am on Mac OS X.5.

So far, I have built openSSL, and then libcurl with that.  When I do a
curl--config --feature I get:

SSL
IPv6
libz
NTLM
NTLM_WB

So, I know libcurl has SSL support.  Next, for cURLpp, I do

./autogen.sh
./configure --without-boost
make
make install

The install goes okay, but when I do curlpp-config --feature I see
only libz.  I would like to see SSL there, to ensure I have SSL
support, right?  Here are some things I've tried so far:

-doing curl--config --libs and then including the output of this in
LDFLAGS prior to autogen'ing for cURLpp.
-pasting ssl's path, /usr/local/ssl , pretty much anywhere I can think
of (like CXXFLAGS, etc.).
-some other last resort moves, not proud of them.

Notably, I am sure that I am building cURL againt the libcurl libs I
just built. This might be useful in case anybody else goes down this
road -- Mac OS seems to have a few versions of these libs spread all
over, probably related to XCode.

I would be very grateful if someone had some advice!

Thanks,
sean

--

-- 
You received this message because you are subscribed to the Google Groups "curlpp" group.
To post to this group, send email to curlpp@...
To unsubscribe from this group, send email to curlpp+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/curlpp?hl=en.

manuel antonio ochoa | 7 Sep 2011 19:42
Picon

[curlpp:215] help with sftp

Hi!! list, good morning

I having some problems to get a conexion with sftp , it told me this :
Maybe the library does not sopport the sftp or is disable .

Some idea about it ?

does anybody have example to get a conexion sftp  ?

thnks

--

-- 
You received this message because you are subscribed to the Google Groups "curlpp" group.
To post to this group, send email to curlpp@...
To unsubscribe from this group, send email to curlpp+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/curlpp?hl=en.

manuel antonio ochoa | 7 Sep 2011 18:10
Picon

[curlpp:214] help with sftp

Hi!! list, good morning

I having some problems to get a conexion with sftp , it told me this :
Maybe the library does not sopport the sftp or is disable .

Some idea about it ?

does anybody have example to get a conexion sftp  ?

thnks

--

-- 
You received this message because you are subscribed to the Google Groups "curlpp" group.
To post to this group, send email to curlpp@...
To unsubscribe from this group, send email to curlpp+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/curlpp?hl=en.

manuel antonio ochoa | 7 Sep 2011 18:06
Picon

[curlpp:213] ayuda con sftp

Que tal lista buenos dias , son nuevo en el uso de la libreria y
obejitvo es utlizarla para descarga de archivos via sftp,
hice un ejemplo
y me marca que la sftp esta desabilitado o no es soportado por la
libreria,
tiene alguna idea ?  o donde econtrar un ejemplo con sftp

saludos.

--

-- 
You received this message because you are subscribed to the Google Groups "curlpp" group.
To post to this group, send email to curlpp@...
To unsubscribe from this group, send email to curlpp+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/curlpp?hl=en.

Bastien | 27 Jul 2011 12:17
Picon
Gravatar

[curlpp:212] Include curlpp in Xcode 4

Hi everyone,

I'm trying to include cURLpp to one of my Xcode project but I get
"file not found" exceptions

I've downloaded curlpp 0.7.3, un-archived it right next to my project
directory and added: "$SRCROOT/../curlpp-0.7.3/include" to the Header
Search Path in Build Settings, also making sure the the recursive
checkbox was selected. That is the only thing I've modified in the
settings.

Any idea why it can't find the header files?
Thanks in advance for your help.

-- Bastien

--

-- 
You received this message because you are subscribed to the Google Groups "curlpp" group.
To post to this group, send email to curlpp@...
To unsubscribe from this group, send email to curlpp+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/curlpp?hl=en.


Gmane