To send a file, such as an image or a PDF file, load the file into memory using a MEMPTR variable, pass it to an OpenEdge.Core.Memptr object, and then attach the Memptr object to the request using the WithData() method.

USING OpenEdge.Net.HTTP.*.
USING OpenEdge.Net.URI.
USING Progress.Json.ObjectModel.*.
USING OpenEdge.Core.Memptr FROM PROPATH.

DEFINE VARIABLE oURI AS URI NO-UNDO.
DEFINE VARIABLE oRequest AS IHttpRequest NO-UNDO. 
DEFINE VARIABLE mData AS MEMPTR NO-UNDO.
DEFINE VARIABLE oPic AS CLASS Memptr NO-UNDO.
DEFINE VARIABLE oClient AS IHttpClient NO-UNDO.
DEFINE VARIABLE oResponse AS IHttpResponse NO-UNDO.
DEFINE VARIABLE oResponseBody AS OpenEdge.Core.String NO-UNDO.
DEFINE VARIABLE JsonString AS LONGCHAR NO-UNDO.
DEFINE VARIABLE oJsonObject AS JsonObject NO-UNDO.

//Build a request
oURI = URI:Parse("http://httpbin.org/post").
COPY-LOB FROM FILE "C:/Samples/smile.png" TO mData.
oPic = new Memptr(mData). 
oRequest = RequestBuilder:POST(oURI):WithData(oPic):Request.

//Execute a request
oClient = ClientBuilder:Build():Client.
oResponse = oClient:Execute(oRequest).

//Process the response
IF oResponse:StatusCode <> 200 THEN
    RETURN ERROR "Request Error: " + STRING(oResponse:StatusCode).
ELSE
    oJsonObject = CAST(oResponse:Entity, JsonObject).
    oJsonObject:Write(JsonString, true). 
    MESSAGE string(JsonString).