cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: facing Space problem in cURL

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Fri, 14 Jan 2011 07:05:27 -0500

On Fri, Jan 14, 2011 at 6:45 AM, prasad deshpande <
prasad.deshpande13_at_gmail.com> wrote:

> Hello,
>
> I am completely new to the cURL. I am trying to integrate Apache Solr with
> c client.
>
> However I am trying to post http request through c client as following.
> How ever I am not getting expected reply from the cURL.
>
> but when I execute same thing through command promt it works fine.
>
> curl "
> http://localhost:8983/solr/update/extract?literal.id=doc1&uprefix=attr_&fmap.content=attr_content&fmap.div=foo_t&boost.foo_t=3&literal.tcent_dataItemOBID=vbofJekpni6w5pdmm70a-buSsuper%20usersuWLocdoc1.pdf&commit=true""
> -F "myfile=@D:/fs/2007_MP6/suWLoc/doc1.pdf"
>
> Can any one help to find what is the exact problem in my code?
>
> int indexInSolr()
> {
> status dstat = OKAY;
> CURL *curl;
> CURLcode res;
>
> curl = curl_easy_init();
> if(curl)
> {
> struct solrString s;
> init_string(&s);
>
> //curl_easy_setopt(curl, CURLOPT_URL, cURLString);
> curl_easy_setopt(curl, CURLOPT_URL, "
> http://localhost:8983/solr/update/extract?literal.id=doc1&uprefix=attr_&fmap.content=attr_content&fmap.div=foo_t&boost.foo_t=3&literal.tcent_dataItemOBID=vbofJekpni6w5pdmm70a-buSsuper%20usersuWLocdoc1.pdf&commit=true\<http://localhost:8983/solr/update/extract?literal.id=doc1&uprefix=attr_&fmap.content=attr_content&fmap.div=foo_t&boost.foo_t=3&literal.tcent_dataItemOBID=vbofJekpni6w5pdmm70a-buSsuper%20usersuWLocdoc1.pdf&commit=true%5C>"\"
> -F \"myfile=@D:\\fs\\2007_MP6\\suWLoc\\doc1.pdf");
>

The simple answer is that that's not a url, it's practically the whole
command line. Try running the command line version with the extra option
"--libcurl filename". That'll get you the correct curl_easy options to add
to your program.

Ralph Mitchell

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-01-14