FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WEBDEV 2024
→
API Authenticate
API Authenticate
Débuté par Mister RUAN, 20 fév. 2017 09:12 - 1 réponse
Connectez-vous…
Mister RUAN
#1
Membre enregistré
209 messages
Popularité : +1 (1 vote)
Posté le 20 février 2017 - 09:12
Good Day
I have an API where the AuthKey is in the header. How would I specify that in my code? I have tried to use the Header function but it doesn't allow me to do so.
c
MyRequest
is restRequest
c
MyRequest
..
URL
=
"https://URLtoGetData"
c
MyRequest
..
Method
=
httpGet
c
MyRequest
..
Header
[
AuthIdentify
(
"ApiKey 123456789"
)
]
c
MyResponse
is restResponse
=
RESTSend
(
c
MyRequest
)
IF
ErrorOccurred
THEN
Error
(
ErrorInfo
(
errFullDetails
)
)
ELSE
Info
(
c
MyResponse
..
Content
)
END
Tested on Postman and this is the code in HTML
GET htmltogetdata HTTP/1.1
Host: partofhtml
Authorization: ApiKey 123456789
Cache-Control: no-cache
Postman-Token: 52d789af-4959-91bb-fee5-02c358551e52
Thanks
Signaler
0
0
Mike Stewart
#2
Posté le 20 février 2017 - 23:17
With the Microsoft graph api I have used httpSendForm, this has a field for additional header entries and this has worked for me for the authentication tokens once they have been granted.
i.e.
IF HTTPSendForm("formName",URLString,httpPost,"",sToken,"text/plain")=True THEN
Where sToken = "Authorization: Bearer "+sTokenAcc
Signaler
0
0
→ Revenir à WEBDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte