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

已提问 2 年前53 查看次数
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 天前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则