[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Net::HTML#post_form with ASP

|MKSM|

3/14/2006 7:09:00 PM

Hello,

I've been trying to use Net::HTML.post_form to POST to a .asp file.

url = URI.parse("http://www.ascca.com/findashop/findashopdetail...)
res = Poster.post_form(url, { "id" => '1' } )
puts res.body

This does not work with ASP pages but works fine with other pages.

Here's the error i get:

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
operator) in query expression '[ID]='.

I believe it has something to do with it being urlencoded, but i'm not
exactly sure.

Any ideas?

Thanks,

Ricardo Amorim


4 Answers

|MKSM|

3/14/2006 7:13:00 PM

0

Just a note: The Poster class is a Net::HTTP subclass. I was using it
to test the code. You could just use Net::HTTP instead.

Regards,

Ricardo

On 3/14/06, |MKSM| <mksm.sama@gmail.com> wrote:
> Hello,
>
> I've been trying to use Net::HTML.post_form to POST to a .asp file.
>
> url = URI.parse("http://www.ascca.com/findashop/findashopdetai...)
> res = Poster.post_form(url, { "id" => '1' } )
> puts res.body
>
> This does not work with ASP pages but works fine with other pages.
>
> Here's the error i get:
>
> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
> operator) in query expression '[ID]='.
>
> I believe it has something to do with it being urlencoded, but i'm not
> exactly sure.
>
> Any ideas?
>
> Thanks,
>
> Ricardo Amorim
>
>


James Gray

3/14/2006 8:45:00 PM

0

On Mar 14, 2006, at 1:09 PM, |MKSM| wrote:

> Hello,
>
> I've been trying to use Net::HTML.post_form to POST to a .asp file.
>
> url = URI.parse("http://www.ascca.com/findashop/findashopdetail...)
> res = Poster.post_form(url, { "id" => '1' } )
> puts res.body
>
> This does not work with ASP pages but works fine with other pages.
>
> Here's the error i get:
>
> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
> operator) in query expression '[ID]='.
>
> I believe it has something to do with it being urlencoded, but i'm not
> exactly sure.
>
> Any ideas?

I think you are running into this:

http://ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-t...

I suspect the fix in that thread will get you going again.

Hope that helps.

James Edward Gray II


|MKSM|

3/14/2006 9:16:00 PM

0

Hello,

The fix did not work.I still get the same error. There is some bug here.

I've tested an app i coded last month and it still works:

url = URI.parse("http://translate.google.com/transla...)
g_res = Net::HTTP::post_form(url, { 'text' => "#{string}", 'langpair'
=> "#{from_lang}|#{to_lang}" } )
p g_res.body

Perhaps it has something to do with the file type you POST to? (php/cfm/asp)

Regards,

Ricardo
On 3/14/06, James Edward Gray II <james@grayproductions.net> wrote:
> On Mar 14, 2006, at 1:09 PM, |MKSM| wrote:
>
> > Hello,
> >
> > I've been trying to use Net::HTML.post_form to POST to a .asp file.
> >
> > url = URI.parse("http://www.ascca.com/findashop/findashopdetai...)
> > res = Poster.post_form(url, { "id" => '1' } )
> > puts res.body
> >
> > This does not work with ASP pages but works fine with other pages.
> >
> > Here's the error i get:
> >
> > [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
> > operator) in query expression '[ID]='.
> >
> > I believe it has something to do with it being urlencoded, but i'm not
> > exactly sure.
> >
> > Any ideas?
>
> I think you are running into this:
>
> http://ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-t...
>
> I suspect the fix in that thread will get you going again.
>
> Hope that helps.
>
> James Edward Gray II
>
>


tirado.carlos

3/15/2006 1:15:00 AM

0

On 3/14/06, |MKSM| <mksm.sama@gmail.com> wrote:
> Hello,
>
> I've been trying to use Net::HTML.post_form to POST to a .asp file.
>
> url = URI.parse("http://www.ascca.com/findashop/findashopdetai...)
> res = Poster.post_form(url, { "id" => '1' } )
> puts res.body
>
> This does not work with ASP pages but works fine with other pages.
>
> Here's the error i get:
>
> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
> operator) in query expression '[ID]='.


The problem is that the receiving end seems to be expecting id in the
query string: request.querystring("id") for GET vs. request.form("id")
for POST in ASP.

HTH

C