I’m lost.
Can someone explain good to me what the difference is between these 2
methods?
‘GET’ and ‘POST’ are two ‘request methods’ which are part of the HTTP
spec.
Your two methods are ruby implementations of such request methods. Read
this:
…and you will see they are quite different.
I have a HTTP:Post and when i check the body, i see exacly what he has
to do. But it doesn’t do it in reality.
How can i resolve the problem?
I have no idea what you are getting at here. Please repost with:
A clear description of what you want to accomplish
How what you are doing now is failing (include error messages)
Your failing code
excerpt of your data causing a failure (if applicable)
If you include all this, you will certainly recieve a more helpful
response.
The First step is to insert javascript into PHP page.
In puts res.body i can see if it works and it works.
The second step is to activate the submit button from the first step,
and this isn’t working.
The First step is to insert javascript into PHP page.
In puts res.body i can see if it works and it works.
The second step is to activate the submit button from the first step, and
this isn’t working.
The First step is to insert javascript into PHP page.
In puts res.body i can see if it works and it works.
The second step is to activate the submit button from the first step, and
this isn’t working.
Do you mean, that there can not be an submit button on a php page?
7stud – schreef:
Here’s the deal. You can make requests to urls. Then a response will
be sent back. There are no submit buttons: there are only urls and
requests. So, you need to figure out what url you want to send a
request to. If you send a request to that url and you don’t get the
response you want, then you either have a problem with your request, or
there is a problem on the server side.
The First step is to insert javascript into PHP page.
In puts res.body i can see if it works and it works.
The second step is to activate the submit button from the first step,
and this isn’t working.
Of course that doesn’t make any sense.
submit button = html
first step = javascript
javascript != html
–> first step != submit button.
request to. If you send a request to that url and you don’t get the
response you want, then you either have a problem with your request, or
there is a problem on the server side.
Thanks for explanation
Sorry, but i still don’t understand.
In the first step when i do an HTTP:Post.new, i can change the behaviour
of the php page, that he inserts some stuff and submit an button, i can
see that when i call puts res.body.
My problem is that after the first step, i have again an submit tbutton
that i want to activate.
request to. If you send a request to that url and you don’t get the
response you want, then you either have a problem with your request, or
there is a problem on the server side.
Thanks for explanation
Sorry, but i still don’t understand.
In the first step when i do an HTTP:Post.new, i can change the behaviour
of the php page, that he inserts some stuff and submit an button, i can
see that when i call puts res.body.
My problem is that after the first step, i have again an submit tbutton
that i want to activate.
This is the way a submit works. The submit button is part of a form.
The form has an action attribute. The action attribute specifies a url.
When you click on a submit button that is displayed on a web page, all
the information entered into the form is inserted into a request. The
request is then sent to the url listed in the action attribute.
In your ruby program, there are no submit buttons. You only have a
string with some html in it(resp.body). Therefore, if you want to send
a request, you need to decide what url to send the request to. If you
want to simulate clicking on a specific submit button, then you need to
send a request to the url specified in the action attribute of the form
that contains the submit button. The request should contain any
information that would have been entered in the form. That means you
have to search resp.body for the url that you want to send your request
to, and your request has to contain all the information that you would
have entered in the form.
of the php page, that he inserts some stuff and submit an button, i can
In your ruby program, there are no submit buttons. You only have a
string with some html in it(resp.body). Therefore, if you want to send
a request, you need to decide what url to send the request to. If you
want to simulate clicking on a specific submit button, then you need to
send a request to the url specified in the action attribute of the form
that contains the submit button. The request should contain any
information that would have been entered in the form. That means you
have to search resp.body for the url that you want to send your request
to, and your request has to contain all the information that you would
have entered in the form.
Thanks again for clarification
This is also what i’m doing. I didn’t explain it very well.
In the first step i’m simulating the submit button like you explained
it. In my resp.body after the first step, i can see that it succeeded.
But my problem is in the second step, i want to simulate again a submit
button from the first step, this is not working and i don’t know what
i’m doing wrong.
First step:
req = HTTP::Post.new("…")
add_headers req, “…”
req.body = body
print “First step”
res = @http.request(req)
puts res.body @http.finish
Second step:
req = HTTP::Post.new("…")
add_headers req, “…”
req.body = body
print “Second step…”
res = @http.request(req)
puts res.body @http.finish
req = HTTP::Post.new("…")
add_headers req, “…”
req.body = body
print “First step”
res = @http.request(req)
puts res.body @http.finish
Second step:
req = HTTP::Post.new("…")
add_headers req, “…”
req.body = body
print “Second step…”
res = @http.request(req)
puts res.body @http.finish
Since you refuse to post any details, like the html and the url, how do
you expect anybody to be able to help you? And suddenly you can
speak english? Or, were you on medication durin your first 3 posts?
Since you refuse to post any details, like the html and the url, how do
you expect anybody to be able to help you? And suddenly you can
speak english? Or, were you on medication durin your first 3 posts?
Can i email you the details?
Englisch is defintaly not my first language and no, i don’t take
medicine
Thnx
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.