php - Callback function -
Then in javascript, I used to be able to start a call request when AJAX sent some data back to the server Sent, successfully made a callback function. Now I'm experimenting with Ruby for OAuth2 Gem, and I'm looking for the callback to not be the same;
I have a web server and Facebook app installed, and I have a small PHP script that writes the file to the current URL (for example, with athletic code), there is no problem. All the settings are set in the Facebook app, and if I put it in the URL in the browser:
http://graph.facebook.com/oauth/authorize?client_id= [My_client_id] And redirect_uri = http: //localhost/oauth/callback/index.php
it successfully redirects to the script, which then writes the authorization code in a file that I then I can use the access token to get the problem The problem is that I can only process it manually I; By using Net :: HTTP.get (URI (address)) the command in Ruby does not seem to initialize PHP scripts.
Is the Ioine having any ideas?
I do not know why you posted your history with a javascript Ajax request, because it's someone on your The Ruby script, which does not have the effect, does not even use the callback method / function. Using the callback function means that you are calling some functions and pass it to another function as argument. When I started programming, the word callback function was very confusing to me, and in my opinion the word should be removed from the language.
For your Ruby script, when you manually enter the URL in your browser, use something like Firebug to see the request headers sent by your browser on the server. If you use the same header in your Ruby script, then it should work, like:
req ['header1'] = 'hello' request ['header 2'] = ' 10 '
or:
header = {' header1 '=> 'Hello', 'header2' => '10', ...} req = Net :: HTTP :: Get.new (uri.request_uri, header) http = Net :: HTTP.new (uri.host, uri.port) resp = http.request (req) ))
It is possible that your browser has a cookie set, which automatically adds the request header to your browser when it sends a request to the server your browser may possibly request Adds thousands of headers - many of which will not have any effect on your problem. If you have the patience, then you can try to figure out that the reason for the request for your ruby script is being broken.
Another option is to use a mechanical gem, which automatically handles cookies. Ruby Script:
(Read the section Let's page Receive
; Do not use the line requires 'rubygems' if you are using Ruby 1.9 +).
Comments
Post a Comment