Huawei Mobile Browser does not support the solution of put submission method

Source: Internet
Author: User

Recently the technical team in the development of the WebApp project, the front-end angularjs+ back-end. Net MVC API,API Login interface is defined as the put submission method, in the compatibility test found that UC, Safari, browser can log in, but in Huawei's own browser login interface always error , the clutch found that the put submission request body is empty, with Inisomnia simulation to submit null and Huawei Browser interface return information, the initial judgment for the browser submitted a null value, Google a bit does exist some mobile browser does not support put submission, after the Huawei official online look at the Someone has come across a similar situation, it seems that the browser does not support put submission.

The final solution is as follows:

Find the data that put and post difference is only the Method logo is not the same, then decided to add the front end to judge, if the Huawei browser and put submitted, the submission Method to post, while adding the Head information field "Real-method", Indicates the real method required for this submission; The backend is judged by the MVC self-contained filter, and if the header information in request contains the "Real-method" field, the request Method is modified to the value of Real-method.

The advantage of this is that you can still support the POST request without modifying the original put interface, which is compatible with mobile browsers that do not support put, and because the interface is also public to the mobile app, so that the logic before the mobile app end does not need to be modified.

(We only found this problem on Huawei 6 PLUS, 4 A, P8 not)

The following code is attached:

Back end:

Huawei Mobile Browser does not support the solution of put submission method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.