Richard Guelzow
Programmer
Hi everyone,
I don't seem able to figure out how to find the correct response for this particular API server. I am supposed to receive this json:
{
"species": "MjAyMS0wNi0wOFQxMToxMzoxNVpbR01UXQ",
"breeds": "MjAyMS0wNi0wOFQxMToxMDo0M1pbR01UXQ",
"genders": "MjAxNS0wNy0yNFQxMjowMDowMFpbR01UXQ",
"tests": "MjAyMy0xMC0yNVQxNTo1MzoyOC4wMDBa"
}
What I receive in both .responsetext & .responsebody [converted with ""+ .responsebody] is what looks like a long javascript document to me:
<!DOCTYPE html>
<html ng-app="vcp.app" lang="{{locale}}">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<script
src=" type="text/javascript"
></script>
<script
type="text/javascript"
src="/vendor/datadog/datadog-rum-config.js"
></script>
Here is my code with dummy credentials:
Any thought to what I am doing wrong? Thanks in advance. Richard
I don't seem able to figure out how to find the correct response for this particular API server. I am supposed to receive this json:
{
"species": "MjAyMS0wNi0wOFQxMToxMzoxNVpbR01UXQ",
"breeds": "MjAyMS0wNi0wOFQxMToxMDo0M1pbR01UXQ",
"genders": "MjAxNS0wNy0yNFQxMjowMDowMFpbR01UXQ",
"tests": "MjAyMy0xMC0yNVQxNTo1MzoyOC4wMDBa"
}
What I receive in both .responsetext & .responsebody [converted with ""+ .responsebody] is what looks like a long javascript document to me:
<!DOCTYPE html>
<html ng-app="vcp.app" lang="{{locale}}">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<script
src=" type="text/javascript"
></script>
<script
type="text/javascript"
src="/vendor/datadog/datadog-rum-config.js"
></script>
Here is my code with dummy credentials:
Code:
m.cUrl = '[URL unfurl="true"]https://partner.vetconnectplus.com/api/v1/ref/versions'[/URL]
m.cUser = 'username'
m.cPass = 'password'
m.cUP64 = STRCONV(m.cUser +':'+ m.cPass , 13)
m.cGettext = '{{"Authorization", "Basic " + ALLTRIM(m.cUP64) }}'
loHTTP = CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")
loHTTP.OPEN("GET", m.cUrl ,.F.)
loHTTP.SEND(m.cGettext)
Response:
loHTTP.status = 200
loHTTP.statustext = ‘OK’
loHTTP.responsetext = The javascript that I listed above.
Any thought to what I am doing wrong? Thanks in advance. Richard