[GH-ISSUE #223] Received SMS POST params being sent as application/json #161

Closed
opened 2026-02-28 01:23:29 +03:00 by kerem · 2 comments
Owner

Originally created by @SystemHunt on GitHub (Nov 11, 2014).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/223

On recent updates, received messages on the phone are being sent to the server with the "application/json" Content-Type, instead of application/x-www-form-urlencoded.
This way, $_POST array on PHP is not being filled with the received POST data in the request.

Originally created by @SystemHunt on GitHub (Nov 11, 2014). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/223 On recent updates, received messages on the phone are being sent to the server with the "application/json" Content-Type, instead of application/x-www-form-urlencoded. This way, $_POST array on PHP is not being filled with the received POST data in the request.
kerem closed this issue 2026-02-28 01:23:29 +03:00
Author
Owner

@eyedol commented on GitHub (Nov 11, 2014):

Are you sure you don't have JSON as the sync scheme?

<!-- gh-comment-id:62552237 --> @eyedol commented on GitHub (Nov 11, 2014): Are you sure you don't have `JSON` as the sync scheme?
Author
Owner

@SystemHunt commented on GitHub (Nov 11, 2014):

You're right, JSON is set. I think I got confused by the fact that switching to JSON was not affecting the post body in the request, but only the Content-Type.
Thanks

Content-Type: application/x-www-form-urlencoded
User-Agent: SMSSync-Android/v2.7.1
secret=&from=%2B99999&message=test&sent_timestamp=1415708371000&sent_to=&message_id=f8c8206b-7140-49dd-970d-f0ee76460b49&device_id=


Content-Type: application/json
User-Agent: SMSSync-Android/v2.7.1
secret=&from=%2B999999&message=test&sent_timestamp=1415716821000&sent_to=&message_id=91e56d63-c70a-4002-8e26-21ee7544ea94&device_id=

<!-- gh-comment-id:62559444 --> @SystemHunt commented on GitHub (Nov 11, 2014): You're right, JSON is set. I think I got confused by the fact that switching to JSON was not affecting the post body in the request, but only the Content-Type. Thanks Content-Type: application/x-www-form-urlencoded User-Agent: SMSSync-Android/v2.7.1 secret=&from=%2B99999&message=test&sent_timestamp=1415708371000&sent_to=&message_id=f8c8206b-7140-49dd-970d-f0ee76460b49&device_id= --- Content-Type: application/json User-Agent: SMSSync-Android/v2.7.1 secret=&from=%2B999999&message=test&sent_timestamp=1415716821000&sent_to=&message_id=91e56d63-c70a-4002-8e26-21ee7544ea94&device_id=
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SMSSync#161
No description provided.