Sie sind auf Seite 1von 2

With

ActiveSheet.QueryTables.Add(Connection:="URL;http://carbon.brighterplanet.com
/flights.txt", Destination:=Range("A2"))
.PostText = "origin_airport=MSN&destination_airport=ORD"
.RefreshStyle = xlOverwriteCells
.SaveData = True
.Refresh
End With

Sub QPX()

Dim sURL As String
Dim sJson As String
Dim xmlDoc As New DOMDocument
Dim sEnvlength As Integer
Dim responseText As String

Dim ApiKey As String
ApiKey = "MyAPIkey"

Set ObjHttp = New MSXML2.XMLHTTP
sURL = "https://www.googleapis.com/qpxExpress/v1/trips/search?key=" &
ApiKey

sJson = sJson & " {"
sJson = sJson & "

""type"": ""APISession"","
sJson = sJson & "

""version"": ""{"
sJson = sJson & "


""major"": ""1"","


sJson = sJson & "

""minor"": ""4"","


sJson = sJson & "

""micro"": ""3"


sJson = sJson & " }"
sJson = sJson & " }"

{
"type": "APISession",
"version": {
"type": "APIVersion",
"major": 1,
"minor": 4,
"micro": 3
}
}


ObjHttp.Open "POST", sURL, False

ObjHttp.setRequestHeader "Content-Type", "application/json"




ObjHttp.send (sJson)

xmlDoc.LoadXML (ObjHttp.responseText)
MsgBox responseText

End Sub



curl -s -X POST -k --data @-
http://192.168.153.156/resources/json/delphix/session \
-c ~/cookies.txt -H "Content-Type: application/json" <<EOF
{
"type": "APISession",
"version": {
"type": "APIVersion",
"major": 1,
"minor": 4,
"micro": 3
}
}
EOF


curl -s -X POST -k --data @- http://192.168.153.156/resources/json/delphix/login
\
-b ~/cookies.txt -H "Content-Type: application/json" <<EOF1
{
"type": "LoginRequest",
"username": "delphix_admin",
"password": "xxxxxxx"
}
EOF1


curl -s -X GET http://192.168.153.156/resources/json/delphix/database \
-b ~/cookies.txt -H "Content-Type: application/json" | python -mjson.tool

Das könnte Ihnen auch gefallen