curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Require help on performing HTTP GET/DELETE/PATCH with http body

From: Badari Prasad via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 8 Nov 2018 20:11:48 +0530

And if CURLOPT_UPLOAD is set for HTTP PATCH/DELETE/GET, http body is sent
to server, and easy handle waits until request times out even though server
has responded back to the request.

On Thu, Nov 8, 2018 at 5:27 PM Badari Prasad <badari.hp_at_gmail.com> wrote:

> Hi Daniel,
> This example works for HTTP GET provided CURLOPT_UPLOAD is set. Else body
> is not sent along with http get. My app does exactly the same as in
> example, uses easy handle for synchronous call.
>
> One difference I did notice is that Expect header was not being sent as
> part of headers in my app for http get/delete, I am using libcurl 7.59.0
> version of libcurl.
>
> O/P of program when I send http get with body to http echo server, which
> echo's the http body it receives in then response to http client.
>
> # ./getcallback
>
> * Trying 10.xx.xx.109...
> * TCP_NODELAY set
> * Connected to 10.xx.xx.109 (10.xx.xx.109) port 11000 (#0)
> > GET /index.cgi HTTP/1.1
> Host: 10.xx.xx.109:11000
> Accept: */*
> Transfer-Encoding: chunked
> Expect: 100-continue
>
> < HTTP/1.1 100 Continue
> < Date: Thu, 08 Nov 2018 11:08:35 GMT
> * Signaling end of chunked upload via terminating chunk.
> < HTTP/1.1 200 OK
> < Request-Number: 11
> < Date: Thu, 08 Nov 2018 11:08:35 GMT
> < Connection: keep-alive
> < Content-Length: 424
> <
> * Connection #0 to host 10.xx.xx.109 left intact
> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vel urna
> neque. Ut quis leo metus. Quisque eleifend, ex at laoreet rhoncus, odio
> ipsum semper metus, at tempus ante urna in mauris. Suspendisse ornare
> tempor venenatis. Ut dui neque, pellentesque a varius eget, mattis vitae
> ligula. Fusce ut pharetra est. Ut ullamcorper mi ac sollicitudin semper.
> Praesent sit amet tellus varius, posuere nulla non, rhoncus ipsum.
>
> Regards
> badari
>
>
> On Thu 8 Nov, 2018, 16:09 Daniel Stenberg, <daniel_at_haxx.se> wrote:
>
>> On Thu, 8 Nov 2018, Badari Prasad via curl-library wrote:
>>
>> > And with PATCH http body (multipart size < 1024 bytes) is sent out,
>> even
>> > though the server has responded to request, transaction at libcurl is
>> timing
>> > out. PATCH with body > 16k works properly.
>> >
>> > Can I get some pointers to debug the issue ?
>>
>> Does this example code work for you?
>>
>> https://curl.haxx.se/libcurl/c/post-callback.html
>>
>> If not, what happens?
>>
>> If it does, what's the difference between this example and your app?
>>
>> --
>>
>> / daniel.haxx.se
>>
>

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-11-08