Skip to content

Issue with Sending File over Form Data #43

@mskhaled

Description

@mskhaled

I'm encountering an issue while attempting to send a file over form data in VB6 using cHTTPRequest. I'm trying to replicate a cURL request that uploads a document to an API endpoint. The cURL command works as expected, but I'm having trouble achieving the same functionality

curl --location --request POST "https://api.mindee.net/v1/products/mindee/invoices/v4/predict" \
--header 'Authorization: Token fd1e97c821b43579a93b571d95aec10d' \
--form 'document=@"/D:/Bon de Livraison.pdf"'
Dim urlText As String
urlText = "https://api.mindee.net/v1/products/mindee/invoices/v4/predict"

With myRequest
    .SetRequestHeader "Authorization", "Token <API TOKEN>"
    .SetRequestHeader "Content-Type", "multipart/form-data"
    .Open "POST", urlText, False
    .Send "document=@" & Chr(34) & "/D:/Bon de Livraison.pdf" & Chr(34)
End With

I would appreciate any insights or suggestions on how to correctly send a file over form data in VB6 using cHTTPRequest. Thank you for your assistance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions