Really hope someone can assist, we are using Azure Mobile App Service and everything works fine in the editor and on IOS, we only have a problem on Android when trying to update an existing record.
According to the Azure resource documentation you need to use Patch
PATCH /tables/tablename/:id Update an existing record in the table
When testing on an Android device it does not even try to send the web request it simply returns error: "Unsupported Protocol"
The research shows that there are workaround solution but I have not found anything relevant to Unity.
I did a search on the forum for HttpMethod.Patch but could not find a single article. Really having some trouble understanding how to resolve the issue and if there is a way to resolve it in Unity.
Any help would be greatly appreciated.
Thanks in advance.
Just thought I would add this, according to the Unity documentation found here: https://docs.unity3d.com/Manual/UnityWebRequest.html
Platforms supported in 5.3:
Mobile Platforms: iOS, Android, Windows Phone 8
Set HTTP verb (GET, POST, HEAD, etc.)
Custom verbs are permitted (So we added Patch)
This should work no problem, but it does not even try to do the UnityWebRequest it just returns the error: 'Unsupported Protocol'
Seeing that the official documentation states that this should work, could this be a bug in UnityWebRequest?
Answer by dgkanatsios
Aug 31, 2016 at 09:52 AM
Just fixed using Easy APIs on Azure https://github.com/dgkanatsios/AzureServicesForUnity
Thank you very very much, your solution is working. Now able to update Azure Easy Table records via the Easy API from Android device.
For anyone looking for a backend database solution working with Unity, well worth looking at this solution,
Answer by Yury-Habets
Aug 18, 2016 at 06:36 PM
The best bet would be to capture the packets and see if Android sends the correct one.
Are all the other verbs working OK on Android?
Been using Fiddler to check the traffic, all the other verbs we are using are working correctly.
However Fiddler is not recording any Patch request. We are updating an entry by ID so we can see that it gets the correct record but then nothing else, this does work 100% in the editor and on IOS.
On Android there is no patch request leaving the device, just the message that the protocol is not supported.
I can share the Fiddler logs but as mentioned there is no request to see what is being sent.
Please submit a bug report, with your project attached, and the Fiddler logs. Thanks!
Bug report has been submitted.
(Case 824415) Trying to use PATCH on a UnityWebRequest onAndroid and getting 'Unsupported Protocol
Actually this is by design. Android supports only verbs from the standard: https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
Everything else generates an exception, for the security reasons.
I'm closing your bug report as "By Design" and updating the Unity documentation.
I don't understand why it would be "ok" on iOS, what would be the point? Having said that you guys are the experts, what would the solution be then to get patch working on android?
I'm on the Android team and have no idea why that works on iOS :)
Android is using Java classes, which follow the W3C standard. It's hard to blame it for following the standard, isn't it?
Answer by deadlyfingers
Nov 22, 2016 at 05:09 PM
You can also install "method-override" for Azure App Services (node backend) to get PATCH to work on Android using UnityWebRequest.
1) Add "method-override": "^2.3.7" to your "package.json" dependencies by running:
npm install method-override --save
2a) Insert the following to your "app.js" express app config (this is explained in the method-override readme)
var methodOverride = require('method-override');
2b) Then after the line var app = express(); add:
var app = express();
3) Now change your update request from "PATCH" to "POST" and add the header:
This will enable the override header and allow you to perform PATCH updates using POST requests which are allowed on Android.
Thanks for this, i will get the team to look at it and get back to you. We decided to use a node.js rather, to avoid the entire ordeal and currently working with a backend fix. again thanks for your solution, will test it asap.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
74 People are following this question.
How to stay connected on a website to send WWWForm?
Error processing web request: Status code 500
HTTP to WWW Help --Small Sample Code Conversion
Building for Windows 10 gives error for HttpWebRequest and StreamWriter
Why current culture is always en-US and what is the alternative ?