Any help making a Ajax plugin with Put and headers

0 favourites
  • 3 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi, if anyone can help me to make a ajax plug (working off default plugin) to do PUT and GET request with custom headers and header responses

    http://www.scirra.com/forum/topic66799_post410385.html#410385

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Just a quick response, im in a hurry, so sorry if this is just pile of crap;

    Runtime.js, around line 149 there's a workaround for cocoonjs:

                   if (method_ === "POST" && data_)

                   {

                        if (request["setRequestHeader"])

                        {

                             request["setRequestHeader"]("Content-Type", "application/x-www-form-urlencoded");

                             request["setRequestHeader"]("Content-Length", data_.length);

                        }

                             

                        request.send(data_);

                   }

                   else

                        request.send();

    Could you use this snippet, make a varible like this.myHeader which you can set, and then replace the "setRequestHeader" with this.myHeader (and other stuff you need), and in construct before making the ajax call set this.myHeader with an action, and then make the call.

    "Need to have something working by end of day :(" -> Ahh, the good 'ole deadlines :D

    Cheers!

  • I tried that but wasn't sure if it was being used in normal browsers, also my normal ajax stops working. I will upload what i have done thus far

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)