Fiddler seems to always say that the content length is 16 times longer
than the actual length and I’m not sure why. Does anyone know how make
this call work? TIA.
Fiddler seems to always say that the content length is 16 times longer
than the actual length and I’m not sure why. Does anyone know how make
this call work? TIA.
-Bach
post data is usually hash like, so maybe this is what you need
( untested )
data = {}
data[“name”]=>‘paul’
data[“url”]=> ‘www.google.com’
post_data = []
data.each_pair do |k,v|
post_data << “#{k}=#{v}”
end @ie.navigate(url, nil, nil, post_data.join(“&”), “Content-Type:
application/x-www-form-urlencoded\r\n”)
You’ll probably have to url encode the data too though
Seems like the postdata parameter is a byte array so here’s what I’ve
post_data << “#{k}=#{v}”
end @ie.navigate(url, nil, nil, post_data.join(“&”), “Content-Type:
application/x-www-form-urlencoded\r\n”)
You’ll probably have to url encode the data too though
Paul
Hi Paul,
Thanks for getting back to me. Seems like IE won’t do a POST unless
that parameter is an array of some sort. If i simply place a string
such as “param1=value1¶m2=value2” (which I think is what your code
is doing) it simply does a GET request and the data is discarded.
I think the issue is that the “navigate” method is expecting a byte
array but from what I can see, all the values in ruby are 32 bits
which is 4 bytes therefore I’m sending extra data.
I still don’t know how to change the output from “each_byte” into 8
bits instead of a 32 bit integer to make this call work.
-Bach
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.