Preciso enviar post com request body como eu faço isso ?
- Code: Select all Expand view
* ===========================================================================
METHOD StartSend(cPostGet, cBody ) CLASS TNimbi
* ===========================================================================
/* pode ser GET ou POST */
DEFAULT cPostGet := "GET"
::oServer := CreateObject( "MSXML2.XMLHTTP")
::oServer:Open( cPostGet, ::cURL, .F. )
::oServer:SetRequestHeader( "Content-Type" , "application/json" )
::oServer:SetRequestHeader( "ClientAPI_ID" , ::cID )
::oServer:SetRequestHeader( "ClientAPI_Key", ::cKey )
::oServer:SetRequestBody( cBody ) -------> Aqui gera um erro, MSXML2.XMLHTTP/3 DISP_E_MEMBERNOTFOUND: SETREQUESTBODY
::oServer:Send( ::cURL )
DO WHILE ::oServer:readyState <> 4
::oServer:WaitForResponse( 500 )
ENDDO
::cRet := ::oServer:responseText
return Self
Obrigado
Ari