0

makerequest error.

Hi,

I am trying to use makerequest to make ajax calls but it always returns error 400.

by
12 Replies
  • Can you please provide a sample of the request you're using please? I'm using the following structure for makeRequest without issue:

    CODE
    var url = 'URL HERE';
    callback = callbackFunc;
    var params = {};
    params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.DOM;
    params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.POST;
    gadgets.io.makeRequest(encodeURI(url), callbackFunc, params);


    Then all you need is callbackFunc defined to handle the callback data like:
    CODE
    function callbackFunc(response){
    if (response.text){
    DO SOMETHING
    }
    }


    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network

    QUOTE (Kramaley G @ Jan 30 2009, 10:35 AM) <{POST_SNAPBACK}>
    Hi,

    I am trying to use makerequest to make ajax calls but it always returns error 400.
    0
  • Hi,

    I am using the following code and I get from obj.errors 'Error 400' nothing else.

    Thank you :) }
    0
  • I'm checking on your code sample now. I'm able to reproduce the 400 so I'll tinker a little bit and see what I can come up with.

    - Jon

    QUOTE (Kramaley G @ Jan 30 2009, 11:56 AM) <{POST_SNAPBACK}>
    Hi,

    I am using the following code and I get from obj.errors 'Error 400' nothing else.

    Thank you :) }
    0
  • Ok I think I know what is going on. In the case of makeRequest here, the code is failing if a full URL is not specified. If you specify the full url to ajax.php (e.g. http://path/ajax.php) that should solve the issue. When I added the full URL makeRequest succeeded.

    Hope that works.

    Jonathan LeBlanc
    Senior Software Engineer
    Yahoo! Developer Network
    0
  • Hi,

    I changed the url to the full path on the server and now I get 'Error 302', any ideas what it means?

    Thanks :)Yahoo! Developer Network
    0
  • hmm, that's a strange one...here's a description of a 302 - http://www.checkupdown.com/status/E302.html

    Do you have an auto-forward on your domain for a temp move?
    Are you attempting to auto-redirect the user during that makeRequest? From researching 302 causes some users were reporting this

    - Jon

    QUOTE (Kramaley G @ Feb 3 2009, 11:14 AM) <{POST_SNAPBACK}>
    Hi,

    I changed the url to the full path on the server and now I get 'Error 302', any ideas what it means?

    Thanks :)
    0
  • I am not using a domain just the server's IP address.

    QUOTE (Jon @ Feb 3 2009, 11:52 AM) <{POST_SNAPBACK}>
    hmm, that's a strange one...here's a description of a 302 - http://www.checkupdown.com/status/E302.html

    Do you have an auto-forward on your domain for a temp move?
    Are you attempting to auto-redirect the user during that makeRequest? From researching 302 causes some users were reporting this

    - Jon
    0
  • I figured out what causes the problem, when I try to access the ajax not through the yahoo fullview I get the yahoo error

    "401 Forbidden

    * Custom port is not allowed or the host is not registered with this consumer key."

    I have tried SIGNED and OAUTH but nothing seems to help with this problem. Do by any chance need a domain ?
    0
  • Regarding the ip address, usually when you first created an application if there was a problem the creation process would have alerted you to it (i.e. non-public address, etc.) but makeRequest may have some issues with that. Just so that I can set up a test case, you mentioned that you are trying to access the ajax not through the yahoo full view, what do you mean specifically? Do you mean that you are trying to call the ajax functionality in the small view or are you making a request to another script which in turn uses makeRequest, or forwarding to a new ip address - something along those lines?

    - Jon

    QUOTE (Kramaley G @ Feb 4 2009, 01:58 AM) <{POST_SNAPBACK}>
    I figured out what causes the problem, when I try to access the ajax not through the yahoo fullview I get the yahoo error

    "401 Forbidden

    * Custom port is not allowed or the host is not registered with this consumer key."

    I have tried SIGNED and OAUTH but nothing seems to help with this problem. Do by any chance need a domain ?
    0
  • Hi,
    I mean that I use the full address of the server like http://195.130.55.66/ajax.php instead of http://apps.yahoo.com/-geDzhp6s/YahooFullView/ajax.php

    QUOTE (Jon @ Feb 4 2009, 12:00 PM) <{POST_SNAPBACK}>
    Regarding the ip address, usually when you first created an application if there was a problem the creation process would have alerted you to it (i.e. non-public address, etc.) but makeRequest may have some issues with that. Just so that I can set up a test case, you mentioned that you are trying to access the ajax not through the yahoo full view, what do you mean specifically? Do you mean that you are trying to call the ajax functionality in the small view or are you making a request to another script which in turn uses makeRequest, or forwarding to a new ip address - something along those lines?

    - Jon
    0
  • To clarify, that address is used in the makerequest code as the full path.
    0
  • Looking into this but in the meantime if you can set this application up with a domain location that should solve the issue. The code provided, with the revisions mentioned, works well for me in a few of the tests I ran.

    - Jon

    QUOTE (Kramaley G @ Feb 5 2009, 07:50 AM) <{POST_SNAPBACK}>
    To clarify, that address is used in the makerequest code as the full path.
    0
  • Recent Posts

    in YAP