cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Server gives 404 error on curl_easy_send()

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 2 Jul 2012 13:01:06 +0200 (CEST)

On Mon, 2 Jul 2012, Sameer Agrawal wrote:

> I am trying to send POST request to a web server using curl_easy_send().

Can I stop you there already? If you intend to do "plain" HTTP, then you
really should not use curl_easy_send() as libcurl itself supports HTTP much
better using the proper curl_easy_perform() API and it will solve lots of
things you have to re-implement yourself otherwise.

> However, I see the "404 error" on the server side. My request is reaching
> the server but server is not able to understand the request.

That's not what 404 means. 404 means the request identified a resource that
doesn't exist. The request can still be perfectly understandable.

> The code works fine when I just call curl_easy_perform() (without
> CONNECT_ONLY option) I am not able to understand why my requests are
> successful on curl_easy_perform() but not on curl_easy_send().

Since you didn't show the full code we can't tell. A quick guess would be that
they post to different URLs.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-02