/dns/:longName

Register a long name. Long names are public names that can be shared.
Only authorised requests can create a directory.

Request Header

Authorization: Bearer <TOKEN> 
Content-Type: text/plain

Response

Ok
Unauthorized
Fields are missing

Examples

var longName = 'safenetwork'; // Long name to be created

var request = require('request');
var endPoint = 'http://localhost:8100/dns/' + longName;

var onResponse = function(err, response, body) {
  if (err) {
    return console.error(err.message);
  }
  if (response.statusCode === 200) {
    return console.log('DNS registered successfully');
  }
  console.error('Operation failed', body);
};

request.post(endPoint, {
  auth: {
    bearer: constants.token
  }
}, onResponse);
Language
Click Try It! to start a request and see the response here!