Pfap
Member
[SOLVED]
posting_match
2
0
2
Content-Length
Date
5
Thu, 24 May 2018 03:40:52 GMT
The above is the show_debug_message(); output of the below program:
show_debug_message(my_response); is empty I'm not to surprised, but how do I get the 5 byte response into a gamemaker variable and preferably a string? The manual isn't to clear on how to work with the response.
I just added this line to my async event:
which showed a 5 character string or "1pfap", which is what the 5 bytes should somehow readout to... I'm trying to use buffers and not just the strings because I'm having issues with my data being changed on php's end or over the network stuff like new lines (\n) being added and php has trim and gamemaker has string_delete(); but I think it may just be less messing around and debugging if I just use buffers.
posting_match
2
0
2
Content-Length
Date
5
Thu, 24 May 2018 03:40:52 GMT
The above is the show_debug_message(); output of the below program:
Code:
if ds_map_find_value(async_load, "id") == request{
show_debug_message("posting_match");
show_debug_message(async_load[? "response_headers"]);
show_debug_message(async_load[? "status"]);
var status = ds_map_find_value(async_load, "status");
if status == 0
{
path = ds_map_find_value(async_load, "response_headers");
show_debug_message(path);
//get the data in the "response_headers" map
var first = ds_map_find_first(path);
var last = ds_map_find_last(path);
show_debug_message(first);
show_debug_message(last);
var value = ds_map_find_value(path, first);
var value2 = ds_map_find_value(path, last);
show_debug_message(value);
show_debug_message(value2);
buffer_write(http_buffer,buffer_string,value);
my_response = buffer_read(http_buffer,buffer_string);
show_debug_message(my_response);
}
show_debug_message(my_response); is empty I'm not to surprised, but how do I get the 5 byte response into a gamemaker variable and preferably a string? The manual isn't to clear on how to work with the response.
I just added this line to my async event:
Code:
result_path = ds_map_find_value(async_load, "result");
show_debug_message(result_path);
Last edited: