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

fend Funcs/FendHttp/httpRequest函数直接将resposne json_decode为array #11

Closed
xmpx310 opened this issue Feb 25, 2021 · 4 comments
Closed

Comments

@xmpx310
Copy link

xmpx310 commented Feb 25, 2021

fend Funcs/FendHttp/httpRequest函数直接将resposne json_decode为array,导致上游数据传来的空数组和空对象无法区分,能否json_decode为stdclass,以方便能保留数据结构

@xmpx310
Copy link
Author

xmpx310 commented Feb 25, 2021

或者允许传参数选择的格式,直接返回json字符串,或者decode为array或者stdClass,

@137-rick
Copy link
Contributor

你好,深入的想了一下,这个属于少数个性的需求
好在这里的逻辑其实很方便挪动,可以将这段代码复制一份,然后在某个地方放一份,作出个性化更改

@xmpx310
Copy link
Author

xmpx310 commented Feb 25, 2021

好吧,那也只能这样的

@xmpx310 xmpx310 closed this as completed Feb 25, 2021
@xmpx310
Copy link
Author

xmpx310 commented Mar 1, 2021

我想了一下,更合理的方式是识别respone header的content-type,跟据content-type去case 如何处理返回结果,可能是json,xml,html等

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

No branches or pull requests

2 participants