Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
El primer carácter en un entorno var se elimina cuando se usa el momento en Postman

Usando el momento en la solicitud previa:

 var yesterday = moment().subtract(1, 'days').format("yyyy-MM-DD"); console.log(yesterday); var pastDate = yesterday; pm.environment.set("pastDate", yesterday)

Cuerpo de la solicitud:

 "AccountId": 1, "StartDate": {{pastDate}}

Respuesta:

 { "errors": { "StartDate": [ "Unexpected character encountered while parsing value: 2. Path 'StartDate', line 7, position 18.", "Input string '022-06-26' is not a valid number. Path 'StartDate', line 7, position 27." ] }, "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1", "title": "One or more validation errors occurred.", "status": 400, }

Sin embargo, al mirar el valor en el entorno: pasado Fecha: 2022-06-26

Entonces, ¿parece que se está eliminando el primer carácter de la variable? No estoy seguro de cómo abordar esto.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

La resolución que encontré fue poner la var entre comillas, ya que JSON necesita recibir fechas dentro de Quote para manipular el valor.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!