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日前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ