Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【建议】get请求参数输入方式跟post 保持一直,中文的encode处理 #36

Closed
wangyibu opened this issue Sep 19, 2016 · 7 comments

Comments

@wangyibu
Copy link

wangyibu commented Sep 19, 2016

  • VSCode Version:1.5.1
  • OS Version:win10
  • REST Client Version:0.7.4

Steps to Reproduce:
建议1. get请求参数的输入方式跟post 保持一直,在最下面

image

建议2. 增加对中文的encode处理

image

@Huachao
Copy link
Owner

Huachao commented Sep 19, 2016

@wangyibu , the advice in suggestion 1 that put query string in the bottom doesn't follow RFC 2616 standard, and also there is a corner case that GET request can contain body. For suggestion 2, it's a nice suggestion. I will implement ASAP

@foxundermoon
Copy link

query放在末尾干嘛,它属于url的一部分。智障宝宝😊

@wangyibu
Copy link
Author

wangyibu commented Sep 19, 2016

@foxundermoon
当然知道query 是参数的一部分,我描述不准确,我建议是提供多种参数格式例如json

例如url: https://search.jd.com/search?keyword=%E7%94%B5%E8%84%91&enc=utf-8&qrst=1&rt=1&stop=1&vt=2&wq=%E7%94%B5%E8%84%91&cid2=671&cid3=12798&ev=212_1675%40933_40614%40149_17976%40&uc=0#J_crumbsBar

GET http://search.jd.com/search HTTP/1.1
    ?keyword=%E7%94%B5%E8%84%91
    &enc=utf-8
    &qrst=1
    &rt=1
    &stop=1
    &vt=2
    &wq=%E7%94%B5%E8%84%91
    &cid2=671
    &cid3=12798
    &ev=212_1675%40933_40614%40149_17976%40
    &uc=0 
Host: search.jd.com
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: https://search.jd.com/search?keyword=%E7%94%B5%E8%84%91&enc=utf-8&qrst=1&rt=1&stop=1&vt=2&wq=%E7%94%B5%E8%84%91&cid2=671&cid3=12798&ev=212_1675%40933_40614%40&uc=0
Accept-Encoding: gzip, deflate, sdch, br
Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4
Cookie: __jdv=122270672|direct|-|none|-; areaId=1; __jda=122270672.105260706.1473833634.1473833634.1474279307.1; __jdb=122270672.12.105260706|1.1474279307; __jdc=122270672; rkv=V0900; ipLoc-djd=1-72-2799-0; ipLocation=%u5317%u4EAC; __jdu=105260706; xtest=17152.7252.d9798cdf31c02d86b8b81cc119d94836.b7a782741f667201b54880c925faec4b; mx=0_X
// 下面这些代码 放入到 get请求后面
[
  { "name": "keyword", "value": "电脑" },
  { "name": "enc", "value": "utf-8" },
  { "name": "qrst", "value": "1" }
  ...
]

PS: 因为不管是前端还是后端经常要序列化参数,返回的参数大部分都是json

@Huachao
Copy link
Owner

Huachao commented Sep 19, 2016

@wangyibu I know your pain, however my concern is still that since GET request can also have request body, how can we distinguish and write such request?

Huachao added a commit that referenced this issue Sep 21, 2016
@Huachao
Copy link
Owner

Huachao commented Sep 21, 2016

@wangyibu suggestion 2 has been fixed and will be available in next release

@Huachao Huachao closed this as completed Sep 21, 2016
@Huachao
Copy link
Owner

Huachao commented Sep 22, 2016

@wangyibu you can try the latest version 0.8.2, and always hope to see you feedback and suggestions 😄

@YourGranny123
Copy link

query放在末尾干嘛,它属于url的一部分。智障宝宝😊

果然自己菜的人,看谁都是菜的,狗眼看人低,智障宝宝。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants