Iniciar sesión

Regístrese para un cálculo de precio individual.

Siempre mantente al día

Con nuestros correos electrónicos, recibirá información regular sobre productos, eventos, servicios y Balluff.

REGÍSTRESE COMO EMPRESA

Verificaremos si ya tiene un número de cliente con nosotros para vincular su nueva cuenta en línea.

Registrarse
Gama de productos
Servicio y asistencia
Sectores y Soluciones
La Empresa
Versión 4.0
·
Última edición el 2025-10-24

REST-API commands via Visual Studio Code and Thunder Client

1. Introduction

This guide shows how to send HTTP commands to a REST-API client using the Thunder Client plug-in in Visual Studio Code.

2. Visual Studio Code Plug-In "Thunder Client"

Attention:
In principle, none of the actions can be undone throughout the plug-in.
Changes are only valid after saving (CTRL + S).

2.1. Installation Plug-In

Click on the "Extensions" tab on the left-hand side and search for "Thunder Client".
Click on the blue "Install" button to install the extension, which will also appear as a separate tab on the left-hand side.

If the tab for the Thunder Client does not appear, it is due to the restricted mode when restarting:

Click on the Restricted Mode field and then confirm under "Trust"


2.2. Use

  1. List of recent commands

  2. Library of commands: Collections
    Predefined commands can be imported or exported into packages here.






    Please note: The free version can only contain 50 commands per collection.

  1. Type of command: GET, POST, DELETE, etc.



  2. Header customization
    Additional header information can be added to the free field:




    Example: Send cookie in the header information:
    Bild

  3. Authentication
    Additional information on different authentication methods can be added here

    Ex: Bearer Token


    Ex: Basic Authetification
    Is transmitted in the header in the format usaername:password in Base64 format.
    Attention: cannot be used for user login!


  4. Body information with different data formats



    Sending files:




  5. Sending the command


  6. Response to the command
    Here is an example of the response to a login process.

    1. Direct response:


    2. Header information


    3. Cookies (separated):


    4. Analyze request:

3. Variablen

There are three types of variables:
Path variables: {{variable}}
Environment variables: {{variable}}
System variables: {{#Variable}}


Environment variables can be defined in the Env tab.



Example: Login with environment variables

  1. Log in and retrieve bearer token



  2. Customize environment variable:


    Attention: Do not forget to save!

  3. Use variable in POST command:

Attention:
The values of the variables are assigned in sequence.
If a variable exists more than once (no check of the editor!), the value of the lowest variable is always assigned,
Ex: Here the variable PortNumber is assigned the value 1.

3.1. Path variables

Path variables are displayed between a single curly bracket.
These can be assigned to a command in the Query tab.

3.2. Environment variables

Environment variables can be defined in the Env tab.



Example: Login with environment variables

  1. Log in and retrieve bearer token



  2. Customize environment variable:


    Attention: Do not forget to save!

  3. Use variable in POST command:

Attention:
The values of the variables are assigned in sequence.
If a variable exists more than once (no check of the editor!), the value of the lowest variable is always assigned,
Example: Here the variable PortNumber is assigned the value 1.


Only one variable list can be active at a time.
You can swap between the variable tables at the bottom of the development environment:

3.3. System variables

System variables are displayed in a double curly bracket and also have a hash {{#variable}}.



Example: Setting the system time using a system variable


Example: Randomly generated values for names, strings or emails

3.4. Automation of processes

A distinction is made between pre-requests and POST requests, which can be sent automatically to a certain extent.
Javascript programs can also be played before or after.

Pre-requests are commands and requests that can be sent before the actual command is sent.

Example: Query whether you are logged in. If not, login is executed.


Scripting example:

Post-requests are sent or processed after the actual command has been executed.

Example: Setting variables.

Example: Checking the command response.

Example scripting: Evaluate response.

Scripting


4. Collections

Predefined collections or YAML files can be inserted via Import.
Each collection can be provided with global settings that affect every command and folder.

A base path can be specified under Options, which is placed in front of each command in the collection.
BaseURL and BasePath are stored here.
Example:
192.168.1.1/api/balluff/v2
The rest of the specific command is defined by the respective command input.

If external APIs are loaded via a YAML file, for example, variables may have to be adapted in the command:
As here, an additional {} must be inserted so that this is recognized as a variable of the Env table.


Attention: Each collection can only contain 50 commands in the free version!

Energy consumption labeling
Energy consumption labeling

EPREL - European Product Database for Energy Labeling

¿Tiene alguna pregunta o sugerencia? Estamos a su disposición.

Para todas las cuestiones relacionadas con temas comerciales, como presupuestos, pedidos o plazos de entrega, nuestro departamento de ventas internas estará encantado de atenderle.


Servicio Técnico
Para solicitudes técnicas relacionadas a productos o soluciones, por favor contacta a nuestro equipo de Servicio Técnico: [email protected]


Ventas Internas
Para cualquier duda referente a temas comerciales como cotizaciones o tiempos de entrega, nuestro equipo de ventas internas te atenderá con gusto: [email protected]


Balluff de México

Anillo Vial II Fray Junípero Serra
No. 4416
Colonia La Vista Residencial.
Querétaro, Qro. CP 76146

Muestra gratuita de producto

Para añadir un producto de muestra gratuita a la cesta tendremos que eliminar todos los productos normales de la cesta. ¿Está seguro de que desea continuar?