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

Json参数请求 #30

Open
jadynwu opened this issue Dec 30, 2019 · 2 comments
Open

Json参数请求 #30

jadynwu opened this issue Dec 30, 2019 · 2 comments

Comments

@jadynwu
Copy link

jadynwu commented Dec 30, 2019

框架只有Form表单的请求方式,入参必须是字典,请问如何优雅的扩展JSON MULTIPART的请求方式

@jadynwu
Copy link
Author

jadynwu commented Dec 31, 2019

由于paramsForApi:方法返回的是Dictionary格式,并在内部实现逐层传递的都是dictionary。

1.用servicetype的方式解决不了
2.如果逐层更改参数类型,那么还需要在APIManager上加一个判断请求数据类型的枚举或string来判断,然后逐层判断。

@casatwy
Copy link
Owner

casatwy commented Dec 31, 2019

由于paramsForApi:方法返回的是Dictionary格式,并在内部实现逐层传递的都是dictionary。

1.用servicetype的方式解决不了
2.如果逐层更改参数类型,那么还需要在APIManager上加一个判断请求数据类型的枚举或string来判断,然后逐层判断。

其实你可以在service里用request generator来生产你需要的request请求的,这需要自己实现一个service。

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