PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WEBDEV 24 → Webhooks
Webhooks
Started by Stephen, Jun., 19 2019 4:27 AM - 1 reply
Registered member
12 messages
Posted on June, 19 2019 - 4:27 AM
Does anyone have any experience building services for providing webhooks in WxDev? I assume it can be done in programming, obviously, but wondering if there is a built-in function we are not yet familiar with that we can take advantage of.
Posted on December, 11 2019 - 12:28 PM
Hi Stephen,

I have never found any component, integrated function to provide webhooks built-in services.

I have just trigger IFTTT webhooks services with windev, something very easy to do.

oRequête est un httpRequête
oRéponse est un httpRéponse
chaineReponse est Variant

// Prépare la requête

E_IFTT_URL="https://maker.ifttt.com/trigger/PERSONAL_EVENT_NAME/with/key/PERSONAL_IFTT_KEY"
oRequête..URL = E_IFTT_URL
oRequête..ContentType = "application/json"

// Transmet la requête
oRéponse = HTTPEnvoie(oRequête)
SELON oRéponse..CodeEtat
CAS 200:
chaineReponse =AnsiVersUnicode(oRéponse..Contenu)
Info("OK"+RC+chaineReponse)


CAS 400, 500:

vErreur est un Variant = JSONVersVariant(oRéponse..Contenu)
ExceptionDéclenche(oRéponse..CodeEtat, vErreur.code + RC + vErreur.message)

CAS 415:
ExceptionDéclenche(415, "Format non supporté")

AUTRES CAS:
ExceptionDéclenche(500, "Erreur HTTP " + oRéponse..CodeEtat)
FIN


Laurent