Last active
December 15, 2015 16:48
-
-
Save unconditional/18b773067030abd09604 to your computer and use it in GitHub Desktop.
yql.auth.basic.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" https="true"> | |
<meta> | |
<sampleQuery>select * from {table} where url="www.yahoo.com" and username="username" and password="password"</sampleQuery> | |
</meta> | |
<bindings> | |
<select itemPath="" produces="JSON"> | |
<urls> | |
<url>{url}</url> | |
</urls> | |
<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" /> | |
<key id="postdata" type="xs:string" paramType="variable" required="true" /> | |
</inputs> | |
<execute> | |
<![CDATA[ | |
y.include("http://www.javarants.com/yss/base64.js"); | |
var auth = "Basic " + Base64.encode(username + ":" + password); | |
response.object = y.rest(url) | |
.header("Authorization", auth) | |
.contentType("application/x-www-form-urlencoded") | |
.post(postdata) | |
.response; | |
]]> | |
</execute> | |
</select> | |
</bindings> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment