Boa Tarde Pessoal,
Preciso usar o webservice com o json no Method POST e não estou tendo sucesso, alguem do forum já fez isso?
Exemplo de como estou usando:
METHOD New() CLASS TFIGGY
********************************************************************************
::cAcesso := 'bd6101cdc209a1b5'
::cURL := 'http://figgy.com.br/ws/datarey'
::cConsulta := 'http://www.figgy.com.br/getDataTypeTest?code=' + ::cAcesso
::aRetorno := Hash()
RETURN( SELF )
METHOD enviaProdutos() CLASS TFIGGY
********************************************************************************
Local cParm := '', aRetorno, oServer, nRetorno := 0
cParm :='[{"cliente_id":'+alltrim(::cAcesso)+','+;
'"cliente_nome":"Farmácia 1",'+;
'"reg_ean":"2569875412356",'+;
'"reg_ms":"1130009950013",'+;
'"nome_comercial":"AAS",'+;
'"apresentacao":"100 MG COM CT BL AL PLAS INC X 30",'+;
'"forma_farmaceutica":"COMPRIMIDO SIMPLES",'+;
'"laboratorio":"SANOFI-AVENTIS FARMACÊUTICA LTDA",'+;
'"tipo_produto":"Referência",'+;
'"princ_ativo":"ACIDO ACETILSALICILICO",'+;
'"preco_promocao":3.45,'+;
'"preco_regular":4.55,'+;
'"qtde_estoque":4,'+;
'"data_cadastro":"19/04/2016 15:45:12",'+;
'"data_atualizacao":"21/04/2016 08:45:22"},'+;
'{"cliente_id":'+alltrim(::cAcesso)+','+;
'"cliente_nome":"Farmácia 1",'+;
'"reg_ean":"2487878759456",'+;
'"reg_ms":"1036701660011",'+;
'"nome_comercial":"MICARDIS ANLO",'+;
'"apresentacao":"40MG + 5MG COM CT BL AL/AL X 10 ",'+;
'"forma_farmaceutica":"COMPRIMIDO SIMPLES",'+;
'"laboratorio":"BOEHRINGER INGELHEIM PHARMA GMBH",'+;
'"tipo_produto":"Referência",'+;
'"princ_ativo":"TELMISARTANA BESILATO DE ANLODIPINO",'+;
'"preco_promocao":72.00,'+;
'"preco_regular":89.00,'+;
'"qtde_estoque":5,'+;
'"data_cadastro":"18/03/2016 17:45:22",'+;
'"data_atualizacao":"15/07/2016 10:42:02"}]'
oServer:=CreateObject( "MSXML2.ServerXMLHTTP")
oServer:Open( "POST", alltrim(::cUrl) , .f. )
oServer:setRequestHeader( "Content-Type", "application/json" )
oServer:setRequestHeader( "CharSet", "utf-8" )
oServer:send( cParm )
cRetorno := oServer:ResponseBody
Msginfo(cRetorno,'cRetorno')
return( aRetorno )