URLConnection con send json data

Salve devo inviare e ricevere informazioni ad e da un servizio di API
Non riesco a capire come riuscire ad inviare un comando SEND con una stringa json (interfaccia JSON-RPC)

Facendo questo:
stringajson= “{”“jsonrpc”": ““2.0"”, ““method””: “””", ““params””: {"“filter”":{}}, ““id””: 1}"

url= “ServiceAPING/v1.0/listEventTypes”
token=“xxxxxx”
APP_key=“ssssssssss”

dim conn as URLConnection
conn.RequestHeader(“X-Application”) = APP_key
conn.RequestHeader(“Content-Type”)= “application/json”
conn.RequestHeader(“Accept”)= “application/json”
conn.RequestHeader(“X-Authentication”)=token

conn.send(“POST”,url,stringajson)

ma il metodo send di URLConnection come valore da inviare vuole un tipo FolderItem:
https://documentation.xojo.com/api/networking/urlconnection.html
URLConnection.Send(method As String, URL As String, file As FolderItem)

e quindi con stringajson mi da errore

in altre parole sostanzialmente devo “replicare” questa funzione vbscript dove DATA una string JSON:

Function SendRequest(Url, AppKey, Session, Data) As String
On Error GoTo ErrorHandler:
Dim xhr: Set xhr = CreateObject(“MSXML2.XMLHTTP”)

With xhr
    .Open "POST", Url & "/", False
    .setRequestHeader "X-Application", AppKey
    .setRequestHeader "Content-Type", "application/json"
    .setRequestHeader "Accept", "application/json"
End With

If Session <> "" Then
    xhr.setRequestHeader "X-Authentication", Session
End If

xhr.send Data
SendRequest = xhr.responseText

If xhr.Status <> 200 Then
    Err.Raise vbObjectError + 1000, "Util.SendRequest", "The call to API-NG was unsuccessful. Status code: " & xhr.Status & " " & xhr.statusText & ". Response was: " & xhr.responseText
End If

Set xhr = Nothing
Exit Function

Qualcuno pu darmi qualche suggerimento?

Use URLConnection.SetRequestContent:

[code]dim conn as URLConnection
conn.RequestHeader(“X-Application”) = APP_key
//conn.RequestHeader(“Content-Type”)= “application/json”
conn.RequestHeader(“Accept”)= “application/json”
conn.RequestHeader(“X-Authentication”)=token

conn.SetRequestContent(stringajson, “application/json”)

conn.send(“POST”,url)[/code]

Andrew, thanks a lot!