I'm trying to convert this curl to ahk, but without sucess.
Anyone can help-me?
Curl CODE:
Code: Select all
curl -s https://app.omie.com.br/api/v1/financas/contapagar/ -H 'Content-type: application/json' -d '{"call":"IncluirContaPagar","app_key":"38333295000","app_secret":"fed2163e2e8dccb53ff914ce9e2f1258","param":[{"codigo_lancamento_integracao":"1668682290","codigo_cliente_fornecedor":4214850,"data_vencimento":"16/11/2022","valor_documento":100,"codigo_categoria":"2.04.01","data_previsao":"16/11/2022","id_conta_corrente":4243124}]}'
My trying with ahk code:
Code: Select all
URL := "https://app.omie.com.br/api/v1/financas/contapagar/"
oHTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1")
oHTTP.Open("POST", URL , False)
oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)")
oHTTP.SetRequestHeader("Referer", URL)
oHTTP.SetRequestHeader("Content-Type", "application/json")
Body := "{'call':'IncluirContaPagar','app_key':'38333295000','app_secret':'fed2163e2e8dccb53ff914ce9e2f1258', 'param':[{'codigo_lancamento_integracao':'1668682290','codigo_cliente_fornecedor':4214850,'data_vencimento':'16/11/2022','valor_documento':100,'codigo_categoria':'2.04.01','data_previsao':'16/11/2022','id_conta_corrente':4243124}]}"
Try
{
oHTTP.Send(Body)
}
Try
{
postRep:=oHTTP.ResponseText
}
Catch
{
postRep := "Error"
}
msgbox %postRep%
ty to help