Should this code not work? I actually have no idea how to use this HTTP request thing.
<script language="javascript">
function HTTPCALL()
{
var request = HTTP.newRequest();
request.open("POST", "https://workplace.intuit.com/db/main", false);
request.setRequestHeader("Content-Type", "application/xml");
request.setRequestHeader("QUICKBASE-ACTION", "API_GetUserInfo");
request.send(
'<qdbapi>
<apptoken>c4abnsde36pse7hzurwvjjb4m</apptoken>
<email>jimmyhogoboom@gmail.com</email>
</qdbapi>'
);
}
</script>
For me, nothing happens. I tried putting an alert anywhere in the function and it never shows. Help!
You cannot use AJAX to send requests to a different domain.
Instead, you can make a server-side proxy on your server that forwards the request to Intuit and relays the response back to the client.
You also have a syntax error – strings cannot span multiple lines.
Therefore, your code won’t even parse, let alone execute.