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).

1 Answer
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
EXPERT
answered 9 hours ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions