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

193
Views
¿Cómo especificar el tipo de contenido como aplicación/json al enviar un mensaje a la cola del bus de servicio de Azure en el nodo js?

Estoy enviando un mensaje a la cola usando el paquete @azure/service-bus y la función sendMessages como se menciona aquí . Cuando envío una matriz de javascript [{ name: "Albert Einstein", "company": "xyz" }] , aparece un error TypeError: Provided value for 'message' must be of type ServiceBusMessage . Entonces, después de que la investigación descubrió, agrega la clave del cuerpo , por ejemplo [body:{name: "Albert Einstein", "company": "xyz"}] . Pero esto inserta un registro con tipo de contenido como application/xml. ¿Hay alguna forma de especificar el tipo de contenido: aplicación/json?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puede especificar contentType como a continuación:

 const messages = [ { body: { "name": "Albert Einstein", "company": "xyz"}, contentType: "application/json" } ]

Consulte ServiceBusMessage :

ingrese la descripción de la imagen aquí

over 4 years ago · Santiago Trujillo 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!