Hi!
Before anything, I should say I'm running libcurl 7.88.1
With that said, the docs say
> CURLUPART_PATH
>
> If a path is set in the URL without a leading slash, a slash will be inserted 
> automatically when this URL is read from the handle.

but the code below results in 400 Bad Request due to the lack of the forward 
slash.
So is it a bug or not?

#include "curl/curl.h"

int main( void )
{
        curl_global_init( CURL_GLOBAL_DEFAULT );

        CURLU *curlu = curl_url();

        curl_url_set( curlu, CURLUPART_URL, "https://httpbin.org";, 0 );
        curl_url_set( curlu, CURLUPART_PATH, "get", 0 );

        CURL *curl = curl_easy_init();
        curl_easy_setopt( curl, CURLOPT_VERBOSE, 1L );
        curl_easy_setopt( curl, CURLOPT_CURLU, curlu );
        curl_easy_perform( curl );

        curl_url_cleanup( curlu );
        curl_global_cleanup();
}
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to