-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in request function when working with multipart/form-data #61
Comments
Thanks, Ali. Do you know why is the extra space needed for the 2nd and following form pairs? I suppose the change is needed here: http-client/src/http/http_client.f90 Lines 250 to 262 in d65b4b1
I wonder if this has to do with how |
Thank you for your prompt response. My test shows that the function |
Hello Ali, as you are utilizing both the file and form concurrently, this code is currently operational. I will proceed to test this code: http-client/src/http/http_client.f90 Lines 440 to 459 in d65b4b1
|
Thank you for your response. This solution may not be ideal, but it works: ! if both file and form are passed
if(allocated(request%form)) then
part_ptr = curl_mime_addpart(mime_ptr)
status = curl_mime_data(part_ptr, request%form(1)%value, CURL_ZERO_TERMINATED)
status = curl_mime_name(part_ptr, request%form(1)%name)
if (size(request%form) > 1) then
do i=2,size(request%form)
part_ptr = curl_mime_addpart(mime_ptr)
status = curl_mime_data(part_ptr, request%form(i)%value, CURL_ZERO_TERMINATED)
status = curl_mime_name(part_ptr, " "//request%form(i)%name)
end do
end if
end if |
I found a bug with the
request
function when working withmultipart/form-data
. The second and following pairs of form variables require an extra space at the beginning!Here is the problem: GitHub Issue #28
Thanks,
Ali
The text was updated successfully, but these errors were encountered: