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개 답변
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
전문가
답변함 11일 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠