Skip to content

Send as form-data with binairy file #216

Closed
@LaurensVanAcker

Description

@LaurensVanAcker

How can I use this library to send the data as form-data instead of application/json and add a file?
I want to implement this interface: https://developer.clearfacts.be/?shell#upload-a-sales-invoice-through-a-mutation

I have a Stream-object with the PDF-file and this:

var uploadRequest = new GraphQLRequest {
    Query = @"
        mutation upload {
            vatnumber: $vat,
            filename: $name,
            invoicetype: $invoicetype
         }",
         OperationName = "upload",
             Variables = new {
                 name = filename,
                 vat = "1234",
                 invoicetype = "SALE"
             }
         };

var graphQLUploadResponse = await graphQLClient.SendMutationAsync<File>(uploadRequest);

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions