405 Not Allowed
Closed this issue · 4 comments
Trying to do POST request im getting 405 Not Allowed. Get is alright.
Please provide more details about the problem:
- App version.
- App mode (e.g., local, private, cloud).
- Request details: URL, headers, body, etc.
- Source of the API documentation for this request.
- 1.16.2 / Build 755
- Both local and cloud
- curl -X POST -u user:passwd -H "Content-Type: application/json" -d '{"message": "test", "phoneNumbers": ["+48571404069"]}' https://sms.capcom.me:443
curl -X POST -u user:passwd -H "Content-Type: application/json" -d '{"message": "test", "phoneNumbers": ["+48571404069"]}' http://10.120.125.100:8080 - Readme.md
- Response from cloud:
<html>
<head><title>405 Not Allowed</title></head>
<body>
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.27.0</center>
</body>
</html>
- RAW response (local)
HTTP/1.1 405 Method Not Allowed
connection: keep-alive
content-length: 0
date: Wed, 31 Jul 2024 08:05:54 GMT - Access to XMLHttpRequest at 'http://192.168.100.53:8080/' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. (different ip due to different local network)
There appears to be an incorrect path in your example request. For sending messages in the case of local mode, you should use /message
as the path, while in cloud mode, you should use /api/3rdparty/v1/message
according to the documentation. Can you please provide a screenshot of the README.md file part, where there is a POST request without a path?
Regarding the CORS (Cross-Origin Resource Sharing) issue, it is not allowed by design for security reasons. To resolve this, you should proxy your requests through a backend server. This ensures that the request is made from a trusted source and helps prevent unauthorized access.