0

form post in YQL

I am trying to use the following query:

select *from html where url=<webpage path>

the web page I am using accepts parameters using POST method, How do I specify these parameters in the query? Unfortunately I can'y pass the parameters as in page.aspx?a=b

by
2 Replies
  • QUOTE (codepainter @ Oct 12 2009, 02:55 PM) <{POST_SNAPBACK}>
    I am trying to use the following query:

    select *from html where url=<webpage path>

    the web page I am using accepts parameters using POST method, How do I specify these parameters in the query? Unfortunately I can'y pass the parameters as in page.aspx?a=b


    You will need to create an open data table with an execute block. In that block you will need to do something like:

    y.rest(url).accept("text/html").contentType("application/x-www-form-urlencoded").post(content)

    Where content is a string of name=value pairs that are url encoded and separated with an &.

    Sam
    0
  • Thanks so much for the tip Sam. I was able to create an open data table (see xml below) and tested it and it worked like a charm!

    <?xml version="1.0" encoding="UTF-8"?>
    <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
    <meta>
    <sampleQuery>select * from {table};</sampleQuery>
    </meta>
    <bindings>
    <select itemPath="" produces="XML">
    <urls>
    <url>http://www.briefing.com/GeneralContent/Active/Investor/TickerSearch/QuickSearch.aspx</url>
    </urls>
    <inputs>
    <key id='TICKER' type='xs:string' paramType='variable' required="true" />
    </inputs>
    <execute><![CDATA[
    // Your javascript goes here. We will run it on our servers
    var content= "Ticker=" + TICKER + "&SearchRadio=EarningsCalendar";
    response.object = request.accept('text/html').contentType("application/x-www-form-urlencoded").post(content).response;
    ]]></execute>
    </select>
    </bindings>
    </table>


    QUOTE (Sam @ Oct 13 2009, 08:16 AM) <{POST_SNAPBACK}>
    You will need to create an open data table with an execute block. In that block you will need to do something like:

    y.rest(url).accept("text/html").contentType("application/x-www-form-urlencoded").post(content)

    Where content is a string of name=value pairs that are url encoded and separated with an &.

    Sam
    0

Recent Posts

in YQL