This snippet uses the built-in OAuth client to request a token and then add it to the HTTP header.

You'll need to configure an entry for the OAuth server with a sub-entry for this specific client:
https://docs.intersystems.com/healthconnectlatest/csp/docbook/Doc.View.c...

In the case of the sample code below, the client I configured is named TestClientA.

    set isAuth=##class(%SYS.OAuth2.AccessToken).IsAuthorized("TestClientA",,"*",.accessToken,.idtoken,.responseProperties,.error)

    $$$TRACE("isAuth:"_isAuth)

    if 'isAuth {
        set tSC=##class(%SYS.OAuth2.Authorization).GetAccessTokenClient("TestClientA", "*",, .error)        
        set isAuth=##class(%SYS.OAuth2.AccessToken).IsAuthorized("TestClientA",,"*",.accessToken,.idtoken,.responseProperties,.error)

        $$$TRACE("isAuth2:"_isAuth)
        
        if 'isAuth {
            quit $$$ERROR(5001,"Problem authenticating")
        }
    }

    $$$TRACE("access_token: "_accessToken)
    $$$TRACE("expires_in: "_responseProperties("expires_in"))
    $$$TRACE("scope: "_responseProperties("scope"))
    $$$TRACE("token_type: "_responseProperties("token_type"))
    
    s tSC=pRequest.HTTPHeaders.SetAt("Bearer "_accessToken,"Authorization")

Here's a working example based on Craig's original sample. It sends a request with 3 mime parts: a form variable with a value, an XML file, and a PDF file loaded from disk.

    set tURL="http://some.url/path/to/upload"

    set tHttpRequest = ##class(%Net.HttpRequest).%New()    
    
    // ----------------------------------------
    // Instantiate reportId MIME Part
    Set reportId = ##class(%Net.MIMEPart).%New()

    // Define/Set the Content-Disposition header indicating how this MIME part is encoded and what it contains.
    // Final string looks like: form-data; name="reportId"
    S tContentDisp = "form-data; name="_$CHAR(34)_"reportId"_$CHAR(34)
    Do reportId.SetHeader("Content-Disposition", tContentDisp)

    // Write the reportId to the MIME Part body.
    Set reportId.Body = ##class(%GlobalCharacterStream).%New()
    Do reportId.Body.Write("RptID12345")
    
    // ----------------------------------------    
    // Instantiate file1 (XML Doc) MIME Part
    
    Set file1 = ##class(%Net.MIMEPart).%New()

    // Define/Set the Content-Disposition header indicating how this MIME part is encoded and what it contains.
    // Final string looks like: form-data; name="file1"; filename="<pRequest.CaseNumber>.xml"
    S tContentDisp = "form-data; name="_$CHAR(34)_"file1"_$CHAR(34)_"; filename="_$CHAR(34)_"xmlfile.xml"_$CHAR(34)
    Do file1.SetHeader("Content-Disposition", tContentDisp)

    // Write XML to the MIME Part body.
    Set file1.Body = ##class(%GlobalCharacterStream).%New()
    Set file1.ContentType = "application/xml"
    do file1.Body.Write("<myXML><element1>value</element1></myXML>")
    
    
    // ----------------------------------------
    // Instantiate file1 (PDF Report) MIME Part
    Set file2 = ##class(%Net.MIMEPart).%New()

    // Define/Set the Content-Disposition header indicating how this MIME part is encoded and what it contains.
    // Final string looks like: form-data; name="file1"; filename="<pRequest.CaseNumber>.xml"
    S tContentDisp = "form-data; name="_$CHAR(34)_"file2"_$CHAR(34)_"; filename="_$CHAR(34)_"PDFFile.pdf"_$CHAR(34)
    Do file2.SetHeader("Content-Disposition", tContentDisp)

    // Get the content for the PDF file
    set tFile=##class(%Stream.FileBinary).%New()
    do tFile.LinkToFile("C:\Projects\test.pdf")

    // Write PDF content to the MIME Part body.
    Set file2.Body = ##class(%GlobalBinaryStream).%New()
    Set file2.ContentType = "application/pdf"
    do file2.Body.CopyFrom(tFile)


    // ----------------------------------------
    // Pack everything up and send the request

    // Package sub-MIME Parts into Root MIME Part
    Set rootMIME = ##class(%Net.MIMEPart).%New()
    Do rootMIME.Parts.Insert(reportId)
    Do rootMIME.Parts.Insert(file1)
    Do rootMIME.Parts.Insert(file2)
    
    
    // Write out Root MIME Element (containing sub-MIME parts) to HTTP Request Body.
    Set writer = ##class(%Net.MIMEWriter).%New()
    Set sc = writer.OutputToStream(tHttpRequest.EntityBody)
    if $$$ISERR(sc) {do $SYSTEM.Status.DisplayError(sc) Quit}
    Set sc = writer.WriteMIMEBody(rootMIME)
    if $$$ISERR(sc) {do $SYSTEM.Status.DisplayError(sc) Quit}
    
    
    // Specify the Content-Type and Root MIME Part Boundary (required for multipart/form-data encoding.)
    Set tContentType = "multipart/form-data; boundary="_rootMIME.Boundary
    Set tSC = tHttpRequest.SetHeader("Content-Type",tContentType)

    // Call SendFormDataArray method in the adapter to execute POST. Response contained in tHttpResponse
    Set tSC=tHttpRequest.Post(tURL)
    
    If $$$ISERR(tSC) {
        // Oops, an error. Do something    
    }

1) Ah, that makes sense. SendFormDataArray is a method in EnsLib.HTTP.OutboundAdapter, but you're not using an adapter.

To do a POST using %Net.HTTPRequest, you'll need to use the Post() method.
 

2) I had a look at the HTTP specs, and it looks like content-disposition is required for each part:

In a multipart/form-data body, the HTTP Content-Disposition general header is a header that must be used on each subpart of a multipart body to give information about the field it applies to. The subpart is delimited by the boundary defined in the Content-Type header. Used on the body itself, Content-Disposition has no effect.

You can set this like any other header using the SetHeader method in %Net.MIMEPart. You're already doing that here:

Do BinaryMIMEPart.SetHeader("Content-Type", ContentType)

Quick example:

Class Demo.FunctionSet Extends Ens.Util.FunctionSet
{

ClassMethod SendRequestToHTTPOp(arg1 as %String, arg2 as %String) as %String {
    if '$D(%Ensemble("%Process")) {
        write "This doesn't work in DTL test mode",!
        quit "OOPS"
    } else {
        #dim bp as Ens.BusinessProcess

        set req = ##class(Ens.StringRequest).%New()
        
        set req.StringValue=arg1_"^"_arg2

        set bp=%Ensemble("%Process")
        set tSC=bp.SendRequestSync("My.HTTP.Operation",req,.resp)
        
        if $$$ISERR(tSC) {
            // Oops... error!
        }
        
        quit "SEND SOMETHING BACK TO WHATEVER CALLED US"
    }
}

}