Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

139
Vistas
K6 Use POST to login in

Ive been working with K6 recently and need to test my API, the login function needs a json in order to get the data but it does not get called on the run, heres my code for the script

import http from 'k6/http';
import { sleep } from 'k6';

export default function () {
  let strGlobalUrl = '192.168.0.1';
  let url = 'http://'+strGlobalUrl+'/api/CompanyLogin';
  let data = JSON.stringify({
    strEmail : 'email',
    strPassword : 'password',
    boolLoginPage : true 
  });

  let params = {
    headers: {
      'Content-Type': 'application/json',
      'dataType': 'json'
    }
  };

  let res = http.post(url, data, params);
  console.log(res.intResponse);
}

It should call the function and get print 200 on the console log, theres something I do wrong or is missing?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I got the answer from my boss, I forgot to include ':5050' in the value of strGlobalUrl due Im testing in my local copy of the server

I hope this would help someone else

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda