En poursuivant votre navigation sur le site, vous acceptez l’utilisation de cookies pour : [vous identifier / personnaliser votre expérience]. Cliquez ici Pour en savoir plus.
...
Why you need to use "Break" ?
-------------------------------------------
Break allows you to easily create any type of request to a server. But not only ! It automatically corrects the urls in case of problems and will come to define itself automatically: the url, the type of request and the type of send. Break also allows response backup as well as a responseJSON if possible. Finally, it automatically detects and manages any type of error and sends it back to you in case of problems!
Command:
---------------------------------------
element.type
element.json
element.url
element.response
element.send
element.connected
element.error
element.correctURL
element.listen
element.method
element.responseType
element.writeHead
element.headerMap
element.request
element.loop
element.ext
Usage:
-----------
req.type //RETRUN THE TYPE OF REQUEST USED
req.json //RETURN THE RESPONSE IN JSON
req.url //RETURN THE URL
req.response //RETURN THE RESPONSE
req.send //SEND
req.connected //RETURN THE STATUS
req.error //RETURN THE STATUS
req.correctURL //RETURN CORRIGED URL
req.listen //FUNCTION TO SET A PORT (example: https://localhost:3000)
req.request //GET THE REQUEST
req.loop //EQUIVAL TO THE ASYNC //DEFAULT IN TRUE
Start:
-------
var request = new BreakRequest("url");
request.on(type, function(){}); //SEE 'https://github.com/YoannCHB/Break#support--all'
Exemple:
-------------
var req = new BreakRequest("https://echo.websocket.org"); //BREAK AUTOMATICALLY SET THE URL ON 'wss://echo.websocket.org'
req.on('message', function(msg){
console.log(msg.data);
});
req.on('error', function(e){
console.error(e);
});
req.on('close', function(e){
console.warn("Server closed ! : "+e);
});
req.on('open', function(response){
if(response){
console.info(response); //JSON
}
req.send('Connection effectued');
});
//req.listen(3000);
req.connect();
06/03/19 : Mode d'emploie
06/03/19 : Première version du script
Vous trouverez un bouton "signaler" en haut à droite de cette fiche pour avertir le créateur d'un problème.
Vous rencontrez une difficulté ou avez besoin d'informations supplémentaires sur le script ? N'hésitez pas à contacter l'auteur en cliquant sur le bouton ci-dessous :
Nombre de visites du script : 719
Moyenne de visites des scripts : 13
Prix de vente moyen d'un script : 3 euros