Apis
Cli
Request Pages

Request Pages

You can test simple server operation without a separate external program.

WARNING

Run this command with the server turned on.
Plain
$ zely request
 
▸ baseURL: http://localhost:3001
 
[12:31:35 AM] info checking server... (requesting /)
 
GET> /
200 {"msg":"Hello","name":""}
GET>

Set header or method using JavaScript code in input prompt.

Plain
GET> config1 = { method: "POST", headers: { }, body: { name: "Cat" } }
GET> set(config1)
POST(config1)> /greeting
200 Hello, Cat!

INFO

All commands except those starting with / are treated as JavaScript code.

INFO

Declare variables without declaration statements such as const or let.

#Functions

The prompt has a few functions to help with the request.

#set()

Set request options.

Javascript
set({
  method: 'METHOD',
  headers: {
    /* headers*/
  },
  body: {
    /* body */
  },
});

#Arguments

optiondescriptiondefault
baseBase URL