Skip to content

Instantly share code, notes, and snippets.

@swook
Created March 30, 2012 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save swook/2248475 to your computer and use it in GitHub Desktop.
Save swook/2248475 to your computer and use it in GitHub Desktop.
HTTP Basic Auth ODT
<?xml version="1.0" encoding="UTF-8"?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>Seon-Wook Park</author>
</meta>
<bindings>
<select itemPath="" produces="XML">
<inputs>
<key id='url' type='xs:string' paramType='variable' required='true' />
<key id='username' type='xs:string' paramType='variable' required='true' />
<key id='password' type='xs:string' paramType='variable' required='true' />
</inputs>
<execute><![CDATA[
y.include("http://yqlblog.net/samples/base64.js");
var authheader = "Basic "+Base64.encode(username+":"+password);
response.object = y.rest(url).header('Authorization', authheader).get().response;
y.sync();
]]></execute>
</select>
</bindings>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment