Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 626 Bytes

simple_url_encode.md

File metadata and controls

35 lines (24 loc) · 626 Bytes
layout title icon group
samples
UTF-8 Encoding of a URL
fa-caret-right
simple

{{ page.title }}

Steps

  1. Create a project utils_url.
  2. Create a JavaScript service with the name url_encode.js.
  3. Enter the following content:
var url = require('utils/v3/url');
var response = require('http/v3/response');

var input = 'http://www.dirigible.io/';
var result = url.encode(input, 'UTF-8');

console.log(('Encoded URL: ' + result));
response.println(JSON.stringify(result));

response.flush();
response.close();

For more information, see the API documentation.