While the above error might seem straightforward, unfortunately it isn't.
My app has an HTTP Post Multipart request that sends some parameters and a CSV file to the client's server. This is the relevant code.
This has been working fine for the last 1 year. Now last week the API server's SSL certificate expired. My client says he renewed it in 2 days. From then on I have been getting this error.
The server part was done in PHP Laravel by someone else. As you can see, I am sending POST request but somehow the client interprets it as GET request. I haven't made any changes to app code in the last 3 months and the PHP developer says he hasn't changed anything either. The only event that happened in between was the SSL expiry.
The issue is only with Multipart POST requests as regular POST requests are working fine. And worst of all, the same POST Multipart request is working fine when checked with POSTMAN, but not from the app. Why?
My app has an HTTP Post Multipart request that sends some parameters and a CSV file to the client's server. This is the relevant code.
B4X:
Dim fd As MultipartFileData
fd.Initialize
fd.KeyName = "filename"
fd.Dir = File.DirInternal
fd.FileName = "orderdata.csv"
fd.ContentType = "text/csv"
Dim jobsubmit As HttpJob
jobsubmit.Initialize("jobsubmit",Me)
jobsubmit.PostMultipart(serverurl, CreateMap("userId":uid,"customer_id":cid,"customer_name":customername,"customer_mobileno":mobileno,"customer_vehicleno":vehicleno,"location_id":locationid,"modeName":Global.CustomerType,"order_date":orderdate), Array(fd))
This has been working fine for the last 1 year. Now last week the API server's SSL certificate expired. My client says he renewed it in 2 days. From then on I have been getting this error.
PHP:
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The GET method is not supported for this route. Supported methods: POST. in file /home/suholcrm/public_html/so/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php on line 117
The server part was done in PHP Laravel by someone else. As you can see, I am sending POST request but somehow the client interprets it as GET request. I haven't made any changes to app code in the last 3 months and the PHP developer says he hasn't changed anything either. The only event that happened in between was the SSL expiry.
The issue is only with Multipart POST requests as regular POST requests are working fine. And worst of all, the same POST Multipart request is working fine when checked with POSTMAN, but not from the app. Why?