Jump to content

fetchRemote error 400


Recommended Posts

Hello, on my computer fetchRemote is working correctly.. but on my VPS I get error #400 (bad request), scripts are the same on my PC and on my VPS.. what could be the problem? The script is server-side ofcourse.

local WEATHER_QUERY = "http://query.yahooapis.com/v1/public/yql?q=select item.condition from weather.forecast where woeid in (select woeid from geo.places(1) where text='CITYGOESHERE')&format=json" 
local players = getElementsByType("player") 
for i = 1, #players do 
    if isPlayerLogged(players[i]) then 
        local query = WEATHER_QUERY:gsub("CITYGOESHERE", getElementData(players[i], "country").region) 
        fetchRemote(query, 2, onReceiveClientWeather, "", false, players[i]) 
        outputDebugString(query) -- Outputs the correct syntax 



I managed to fix it, not sure why it wasn't working on VPS but I had to add %20 for each space on the URL. :redhotevil:

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...