Android Question MethodNotAllowedHttpException: The GET method is not supported for this route.

Inman

Well-Known Member
Licensed User
Longtime User
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.

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?
 

Sandman

Expert
Licensed User
Longtime User
So basically this is the situation:

1. The app is unchanged
2. Your client changed things on the server
3. The server code is unchanged

It would seem to me that you are asking the wrong people about this. You should have the discussion with your client, the only person in the situation who actually changed something.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
the get may relate to the CA's attempt to verify the site's certificate. while the certificate may well be valid now, the url used when obtaining the necessary files may be incorrect. looks to me like the address provided is one that only accepts post. when the CA uses it (for a get), the site rejects the request.
 
Upvote 0
Top