How to use the request function from restler
Find comprehensive JavaScript restler.request code examples handpicked from public code repositorys.
30 31 32 33 34 35 36 37 38 39
options.headers['Content-Type'] = 'application/json'; } options.parser = rest.parsers.json; rest.request(this.url(url), options).addListener('success', function(data) { p.emitSuccess(data); }).addListener('error', function(data) { p.emitError(data); });
0
11
3
GitHub: zhmlvft/nw-rest-client
25 26 27 28 29 30 31 32 33 34
options.username=username; options.password=password; } //获取url var url = $('#inputUrl').val(); rest.request(url,options).on("timeout",function(ms){ //输出超时信息 $('#res_body').removeClass().addClass("hljs").html("<h2 style='color:red'>连接超时,请检查网络和地址是否可用</h2>"); }).on('complete', function(data,response) { var headers = response.headers;
0
3
2
+ 64 other calls in file
31 32 33 34 35 36 37 38 39 40
headers: { 'Content-Type': 'application/json' }, parser: rest.parsers.json }; rest.request(base+url, options).on('success', function(data) { // console.log("In handle_request.success: " + url); handle_success(data, callback, error); }).on('fail', function(data) { // console.log("In handle_request.fail: " + url);
0
0
2
restler.get is the most popular function in restler (475 examples)