1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add strict mode and latest icons to http node(s)

This commit is contained in:
Dave C-J 2014-06-08 15:05:08 +01:00
parent 0cbc277a2c
commit 00f87cbcd6
2 changed files with 68 additions and 73 deletions

View File

@ -16,8 +16,8 @@
<script type="text/x-red" data-template-name="http in">
<div class="form-row">
<label for="node-input-method"><i class="icon-tasks"></i> Method</label>
<select type="text" id="node-input-method" style="width: 150px;">
<label for="node-input-method"><i class="fa fa-tasks"></i> Method</label>
<select type="text" id="node-input-method" style="width:72%;">
<option value="get">GET</option>
<option value="post">POST</option>
<option value="put">PUT</option>
@ -25,11 +25,11 @@
</select>
</div>
<div class="form-row">
<label for="node-input-topic"><i class="icon-globe"></i> url</label>
<label for="node-input-topic"><i class="fa fa-globe"></i> url</label>
<input type="text" id="node-input-url" placeholder="/url">
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div id="node-input-tip" class="form-tips">The url will be relative to <code><span id="node-input-path"></span></code>.</div>
@ -66,7 +66,7 @@
<script type="text/x-red" data-template-name="http response">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-tips">The messages sent to this node <b>must</b> originate from an <i>http input</i> node</div>
@ -85,8 +85,8 @@
<script type="text/x-red" data-template-name="http request">
<div class="form-row">
<label for="node-input-method"><i class="icon-tasks"></i> Method</label>
<select type="text" id="node-input-method" style="width: 150px;">
<label for="node-input-method"><i class="fa fa-tasks"></i> Method</label>
<select type="text" id="node-input-method" style="width:72%;">
<option value="GET">GET</option>
<option value="POST">POST</option>
<option value="PUT">PUT</option>
@ -94,7 +94,7 @@
</select>
</div>
<div class="form-row">
<label for="node-input-url"><i class="icon-tasks"></i> URL</label>
<label for="node-input-url"><i class="fa fa-globe"></i> URL</label>
<input type="text" id="node-input-url" placeholder="http://">
</div>
<div class="form-row">
@ -103,15 +103,15 @@
<label for="node-input-useAuth" style="width: 70%;">Use basic authentication?</label>
</div>
<div class="form-row node-input-useAuth-row">
<label for="node-config-input-user"><i class="icon-user"></i> Username</label>
<label for="node-config-input-user"><i class="fa fa-user"></i> Username</label>
<input type="text" id="node-config-input-user">
</div>
<div class="form-row node-input-useAuth-row">
<label for="node-config-input-pass"><i class="icon-lock"></i> Password</label>
<label for="node-config-input-pass"><i class="fa fa-lock"></i> Password</label>
<input type="password" id="node-config-input-pass">
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
@ -284,9 +284,3 @@
}
});
</script>

View File

@ -15,7 +15,7 @@
**/
module.exports = function(RED) {
"use strict";
var util = require("util");
var http = require("follow-redirects").http;
var https = require("follow-redirects").https;
@ -153,6 +153,7 @@ module.exports = function(RED) {
url = nodeUrl;
}
var method = (msg.method||nodeMethod).toUpperCase();
node.log(method+" : "+url);
var opts = urllib.parse(url);
opts.method = method;
opts.headers = {};