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

90
Vistas
REST API URL resource with parameter inside parentheses

In a project I am currently working on I was given the following HTTP POST command definition below (client requirement written in stone) which I have to implement into a webserver which is currently based on a MEAN STACK.

{{Host}}/Products('{{ProductId}}')/Data.Order

How can I implement this? I am not used to parameters inside parentheses for a specific resource.

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

0

Express should be able to resolve the path-placeHolder (through :<placeHolder>), even if it's within this rather unusual parentheses. So try defining your endpoint as follows:

app.post('/Products(:productId)/Data.Order',(req, res, next) => {
    console.log("productId is", req.params.productId);

    res.status(201).end();
})

Calling this endpoint with POST http://<host>:<port>/Products(12345)/Data.Order should log 12345 to the console.

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