> For the complete documentation index, see [llms.txt](https://abi.gitbook.io/net-core/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://abi.gitbook.io/net-core/14.-introduccion-a-postman/14.1-probar-tus-servicios-con-postman.md).

# 13.3 Crear colecciones en Postman

Puedes consultar la sección [4.4 Probando tus servicios con POSTMAN](https://abi.gitbook.io/net-core/4.-creando-tu-primer-servicio/4.4-probando-tus-servicios-con-postman) si deseas consultar los conceptos básicos para probar con postman.

Postam te permite organizar tus tests en colecciones, la cual te permite agrupar diferentes servicios y mediante archivos que se llaman environments puedes probar tus servicios en diferentes servidores.

### Pasos para probar con Postman

Los pasos básicos para probar con Postman son:

1. Crear una colección
2. Agregar los diferentes request a tu colección para probar todos los casos (correctos e incorrectos). Puedes agruparlos en carpetas para mejor organización y compartir código.
3. Agregar con javascript todos tus assert en el tab Test.
4. Si deseas probar en diferentes servidores (Desarrollo, Pruebas, Producción) crear un environmnent para configuar  la URL de cada servidor.
5. Si deseas probar el mismo servicio con diferentes valores  puedes crear un archivo csv  con los diferentes valores que deseas probar.

### Crear una colección para probar el Login

1. Da clic en el botón **+ New Collection** o en el botón **+ Create Collection**
2. En **name** teclea el nombre de la colección, por ejemplo teclea el nombre del servicio que deseas probar. En este ejemplo es Login
3. **Description**: Agrega la descripción del servicio y los casos que deseas probar, utiliza markdown. En mi caso agregué una nota indicando que el caso de envio de código por usuario incorrecto se puede probar como integración y no con postman.
4. Da clic en el botón **Create**.

![](/files/-MCKLkxF-hcjjCKTZEa_)

Puedes organizar los test de acuerdo al status code. Para este servicio crea las siguientes carpetas:

* 200&#x20;
* 400
* 403

5\. Crea una carpeta dando clic en los **...** y luego en **Add Folder**

![](/files/-MCPQ3LobgTA5jFwILG5)

6\. Agrega el nombre y descripción y da clic en **Create**

![](/files/-MCPRJ_l9QvvZ6GDoBry)

### Crear el request para llamar el servicio login

1. Da clic en **Add requests** configura lo siguiente:

* **Request name:** agrega un nombre, al igual que los test unitarios, te recomiendo que el nombre sea el nombre del servicio, a continuación el caso y por último lo que esperas obtener. En este ejemplo es: **Login\_UsuarioPasswordCorrectos\_Return200Token.**&#x20;
* **Request description:** Agrega una descripción mas detallada del caso

![](/files/-MCPSGJUG1v8aqfMy9VP)

2\. Da click en **Save to 200**

3.Configura los datos necesarios para ejecutar el servicio:

* **Método**: Es el método de tu servicio. En este caso el login es **POST**
* **Request Url**: La url del serivicio a probar. <http://localhost:5000/api/Usuarios/Login>
* **Tipo**: Selecciona **raw** para indicar que es texto y no viene de una forma ni de un archivo ni es tipo GraphQL
* **Content-Type**: Selecciona **JSON** ya que enviaremos un JSON
* **Body**: Agrega el json requerido para tu servicio. Para el servicio login se necesita:

```
{
  "Usuario": "Juan",
  "Password": "password del usuario"
}
```

![](/files/-MCPVaOqb6cI-aSMROxX)

4\. Da clic en **Send** para llamar el servicio y obtener el resultado

###


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://abi.gitbook.io/net-core/14.-introduccion-a-postman/14.1-probar-tus-servicios-con-postman.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
