not getting response from http endpoint in php

0

I created a websocket api that fetches data from an http endpoint in php. the Endpoint receives the sent data, but in the returned data not received by the client d socket.

Example of the endpoint response script:

<?php $rtn["id"] = "3"; $rtn ["name"] = "John"; http_response_code(200); echo json_encode($rtn); Can anyone help me to solve this, please?
  • Which AWS services are you using? And how does the overall architecture look like (e.g., PHP app hosted on EC2 talking to a WebSocket API running in API Gateway).

preguntada hace 2 años53 visualizaciones
1 Respuesta
0

Hello, I would check integration is correctly set up on the API GW. Are there are any errors in the response being returned from the backend ? The response needs to be valid JSON that the client can parse. Please provide more information on the environment around your issue.

P.S. If you are using Websockets API From SAM, I suggest you move to API GW, which is smoother to manage and less prone to headaches

profile picture
EXPERTO
respondido hace 11 días

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas