ios - GET如何以BODY传输?
巴扎黑
巴扎黑 2017-04-17 13:08:46
0
3
791

GET一般是以Parameter传输。但是现在在IOS端需要把GET传输的数据以body传输。

这样做的原因:为了实现数据传输过程都以body方式加密传输。

问题:

1.GET传输的数据以body传输,在IOS上如何实现。

2.如果GET方式Parameter传输,这样会不会没有BODY安全?一般安全性特高的,也是GET方 式Parameter传输?

3.如果全部用POST方式。这样完全不符合REST API风格。

巴扎黑
巴扎黑

reply all(3)
大家讲道理

Theoretically there is no essential difference between GET and POST, so it is recommended to use POST.

Also, if you must use GET, it is recommended to put the data to be transmitted in the same object. For example, the content you want to transmit is:

http://example.com/api?paramA=valueA&paramB=ValueB&paramC=ValueC

You can first construct the object to be transmitted (for example, use JSON format, other formats do not matter):

{"paramA":"valueA","paramB":"valueB","paramC":"valueC"}

Then encrypt this object, for example, get the ciphertext:

uyUYbJhkIU*^GmklJL(Tu6RJHGHYRhgV$6U%&^%M<HJFHGFjJHGjgj

Do URL Encode again and transmit:

http://example.com/api?data=uyUYbJhkIU%2A%5EGmklJL%28Tu6RJHGHYRhgVU%25%26%5E%25M%3CHJFHGFjJHGjgj

伊谢尔伦

You can just use post transmission directly. Regarding security, please read the information related to signature verification. There are other ways to ensure it.

伊谢尔伦

To put data into the body, it must be retrieved through POST, which is restricted by the HTTP protocol.

Since data is to be transmitted, use POST.

What GET passes is not data, but other additional parameters. When the url cannot describe a uri resource in detail, use parameters to assist, such as paging, sorting, etc...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!