x-client-id
header with some value that is used to recognize the client. Because of the separation of the environments, you have to use different keys for both environments. To deal with this create two environments for "production" and "stage" and create apiClientId
variables with corresponding values. You can use the variable as ${apiClientId}
in the headers editor as a value. The value is automatically added to the headers before sending the request to the server. ${
before variable name and }
after it.slice
function from String
class to demonstrate the principle. The slice
function accepts two arguments start and end and returns a string that contains characters found between the start index and end index. We are going to "slice" our ${username}
variable to get a string from position 1 to 3. We would use the following syntax: String.slice(${username}, 1, 3)
where the first argument is the string we are operating on and other arguments are arguments passed to the JavaScript function."uname".slice(1, 3)
which result with na
.now
random
decodeURIComponent
and encodeURIComponent
functions.