Amigos buenas tardes,
Estoy intentado ejecutar el metodo POST untilizando FWREST y al realizar el POST me retorna error 400, este mismo teste lo realizo en POOSTMAN y funciona correctamente la petición.
Ejemplo en postman del metodo POST:
http://201.221.224.124:91/panama/comprobante?request={"documentNumber": "FA2550","documentType": "A","customerName": "Julieta Aguirre","customerId": "AN586474","customerAddress": "Albrook","items": [{"code":"31","description": "Tratamiento","qty": "1","price": "20","tax":"7"}],"payments": [{"title": "Efectivo","amount": "40.00","type": "1"}]}
Ejemplo FWREST en protheus:
local cConectApi := "http://201.221.224.124:91"
local oRestClt := Nil //FWRest():New(cTesteApi)
local aHeader := {}
local cJSON := ""
local oObj := Nil
local cResulRest := Nil
oRestClt := FWRest():New(cConectApi)
aAdd(aHeader,"Content-Type: application/json")
oRestClt:setPath( '/panama/Comprobante?request={"documentNumber": "FAT25101902","documentType": "A","customerName": "Julieta Aguirre","customerId": "AN586474","customerAddress": "Albrook","items": [{"code":"31","description": "Tratamiento","qty": "1","price": "20","tax":"7"}],"payments": [{"title": "Efectivo","amount": "40.00","type": "1"}]}')
cJson := ""
if oRestClt:Post(aHeader)
cResulRest := oRestClt:GetResult()
else
Alert(oRestClt:GetLastError())
endif
Aqui presenta el error 400