You need to use the correct object type as the payload. In this case that's going to be an instance of a String object. Please make sure that you also set the correct ContentType on the request. For example to send the following HTTP POST messages from an OpenEdge client:
POST https://www.googleapis.com/oauth2/v3/token HTTP/1.1
Content-type: application/x-www-form-urlencoded
Host: www.googleapis.com
client_id=your_client_id&client_secret=your_client_secret&refresh_token=your_refresh_token&grant_type=refresh_token
You can use the following ABL code:
BLOCK-LEVEL ON ERROR UNDO, THROW.
USING OpenEdge.Core.String.
USING OpenEdge.Net.HTTP.ClientBuilder.
USING OpenEdge.Net.HTTP.IHttpRequest.
USING OpenEdge.Net.HTTP.IHttpResponse.
USING OpenEdge.Net.HTTP.RequestBuilder.
USING Progress.Json.ObjectModel.JsonObject.
DEFINE VARIABLE httpUrl AS CHARACTER NO-UNDO.
DEFINE VARIABLE oRequest AS IHttpRequest NO-UNDO.
DEFINE VARIABLE oResponse AS IHttpResponse NO-UNDO.
DEFINE VARIABLE oRequestBody AS String NO-UNDO.
DEFINE VARIABLE oJsonEntity AS JsonObject NO-UNDO.
DEFINE VARIABLE JsonString AS LONGCHAR NO-UNDO.
SESSION:DEBUG-ALERT = TRUE.
httpUrl = "https://www.googleapis.com/oauth2/v3/token".
oRequestBody = new String('client_id=your_client_id&client_secret=your_client_secret&refresh_token=your_refresh_token&grant_type=refresh_token').
oRequest = RequestBuilder:Post("https://www.googleapis.com/oauth2/v3/token", oRequestBody)
:ContentType('application/x-www-form-urlencoded')
:AcceptJson()
:Request.
oResponse = ClientBuilder:Build():Client:Execute(oRequest).
MESSAGE
oResponse:StatusCode SKIP
oResponse:StatusReason SKIP
VIEW-AS ALERT-BOX.
oJsonEntity = CAST(oResponse:Entity, JsonObject).
oJsonEntity:Write(JsonString, TRUE).
MESSAGE STRING(JsonString)
VIEW-AS ALERT-BOX.