Genpact Cora Knowledge Center

Support

Create Workflow using Http Consumer Activity with MultipartFormDataContent File Upload

Overview

As a workflow developer you can build a workflow with an Http Consumer activity that includes a MultipartFormDataContent component in the request payload.

Message structure

NOTE
In the message structure below, the items highlighted in Red are specific to the MultipartFormDataContent file upload component. All other properties are standardHttpRequestMessage members.

 

Send
    HttpRequestMessage message
    string RequestUri = ToString(JsonValue({Get EaaS Config}.ReturnValue).uploadUrl.Value) 
    HttpMethod(PostHttpMethod) Method     
    HttpContent(MultipartFormDataContent) Content
        string Boundary = null
        List<HttpContent> Body
            HttpContent_0
            byte[] Body = {Input}.In["body"].DynoTestFile == null ? mwf.Extensions["CaseAttachments"].Items.Where(FileName == wf.variables["FileName"]).First().Content : {Input}.In["body"].DynoTestFile.FileBytes
            HttpContentHeaders Headers
            List<string> Allow = null
            ContentDispositionHeaderValue ContentDisposition
                DateTime? CreationDate = null
                string DispositionType = "form-data"
                string FileName = wf.Variables["fileName"]
                string FileNameStar = wf.Variables["fileName"]
                DateTime? ModificationDate = null
                string Name = "file"
                DateTime? ReadDate = null
                long? Size = null
                List<NameValueHeaderValue> Parameters = null
            List<string> ContentEncoding = null
            List<string> ContentLanguage = null
            long? ContentLength = null
            string ContentLocation = null
            byte[] ContentMD5 = null
            ContentRangeHeaderValue ContentRange = null
            MediaTypeHeaderValue ContentType
                string MediaType = "application/pdf"
                string CharSet = null
                List<NameValueHeaderValue> Parameters = null
            List<HttpHeader> CustomHeaders = null
        HttpContentHeaders Headers = null
    string Version = null
    HttpRequestHeaders Headers
        List<MediaTypeWithQualityHeaderValue> Accept = null
        List<StringWithQualityHeaderValue> AcceptCharset = null
        List<StringWithQualityHeaderValue> AcceptEncoding = null
        List<StringWithQualityHeaderValue> AcceptLanguage = null
        AuthenticationHeaderValue Authorization = null
        CacheControlHeaderValue CacheControl = null
        List<string> Connection = null
        bool? ConnectionClose = null
        List<CookieHeaderValue> Cookies = null
        DateTime? Date = null
        List<NameValueWithParametersHeaderValue> Expect = null
        bool? ExpectContinue = null
        string From = null
        string Host = null
        List<EntityTagHeaderValue> IfMatch = null
        DateTime? IfModifiedSince = null
        List<EntityTagHeaderValue> IfNoneMatch = null
        RangeConditionHeaderValue IfRange = null
        DateTime? IfUnmodifiedSince = null
        int? MaxForwards = null
        List<NameValueHeaderValue> Pragma = null
        AuthenticationHeaderValue ProxyAuthorization = null
        RangeHeaderValue Range = null
        string Referrer = null
        List<TransferCodingWithQualityHeaderValue> TE = null
        List<string> Trailer = null
        List<TransferCodingHeaderValue> TransferEncoding = null
        bool? TransferEncodingChunked = null
        List<ProductHeaderValue> Upgrade = null
        List<ProductInfoHeaderValue> UserAgent = null
        List<ViaHeaderValue> Via = null
        List<WarningHeaderValue> Warning = null
        List<HttpHeader> CustomHeaders
        HttpHeader_0
            string Name = "Authorization"
            string Value = "Bearer TSerG/****C+c="
        HttpHeader_1
        string Name = "accept"
        string Value = "application/json"
    SessionOptions SessionOptions = null