HTTP – Giavapps Game Jolt API

 

About HTTP Functions

 

HTTP functions are ment for easy-access to the various values stored in the default HTTP ds_map (async_load).

 

HTTP Functions

 

gj_http_id() Returns the value for the key "id" stored in the default HTTP ds_map (async_load).

 

gj_http_status() Returns the value for the key "status" stored n the default HTTP ds_map (async_load).

 

gj_http_status_code() Returns the value for the key "http_status" stored in the default HTTP ds_map (async_load).

 

gj_http_data_size() Returns the value for the key "contentLength" stored in the default HTTP ds_map (async_load).

 

gj_http_data_downloaded() Returns the value for the key "sizeDownloaded" stored in the default HTTP ds_map (async_load).

 

gj_http_result() Retrieves result data for gj_result_* functions from any http request sent to the Game Jolt API. This function returns the value of the specified key ("return") stored in the default HTTP ds_map (async_load).

 

Code Examples

 

Authenticating User’s Information

 

Create Event

 

gj_init("game_id","private_key");//Initializes Giavapps Game Jolt API
request_user_auth = gj_user_auth("username","user_token");//Authenticates the user

 

Game End Event

 

gj_deinit();//Deinitializes Giavapps Game Jolt API

 

Async – HTTP Event

 

if(gj_http_status() != 0){exit;}//Checks if the status is complete

gj_http_result();//Retrieves result data for gj_result_* functions

if(gj_http_id() == request_user_auth)//Checks if the id is equal to the http request id
{

if(gj_result_success())
{
show_debug_message("THE USER’S CREDENTIALS ARE VALID!");
}
else
{
show_debug_message("THE USER’S CREDENTIALS ARE INVALID!");
}

}

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*