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

Write a serializer for multipart encoded forms #5022

Open
humitos opened this issue Dec 20, 2018 · 5 comments
Open

Write a serializer for multipart encoded forms #5022

humitos opened this issue Dec 20, 2018 · 5 comments
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code Status: blocked Issue is blocked on another issue

Comments

@humitos
Copy link
Member

humitos commented Dec 20, 2018

In #5000 we are manually manipulating the request to send the data using MultipartEncoder directly to avoid an issue that we found when sending large data.

The proposal is a solution, but we think it could be cleaner if we write a Slumber serializer and we use it directly instead of touching the request at that level: https://slumber.readthedocs.io/en/v0.6.0/options.html#serializer

Also, once this serializer is written and tested, we need to double check if #5021 disappears with the usage of a serializer.

@humitos humitos added Improvement Minor improvement to code Accepted Accepted issue on our roadmap labels Dec 20, 2018
@dojutsu-user
Copy link
Member

@humitos
I am trying to solve this issue.
But I'm facing some problems
I have made a serializer class but can't make it to work with readthedocs.restapi.client.api.
How to use that?

@humitos
Copy link
Member Author

humitos commented Dec 23, 2018

@dojutsu-user well, I don't exactly know how to do it since I've never done it before, but the documentation linked in the description should guide you.

When instantiating the client, it passes the serializer:

s = serialize.MySerializer()
api = slumber.API("http://example.com/api/v1/", format="pickle", serializer=s)

@dojutsu-user
Copy link
Member

dojutsu-user commented Dec 23, 2018

@humitos
Actually, slumber is always using the default serializer because the format parameter is not taken into the account. That's why I wasn't able to get this working. I searched a little bit and found that there's an open issue also:
samgiles/slumber#131

So, may be we won't be able to do this with slumber.

@humitos
Copy link
Member Author

humitos commented Dec 24, 2018

Yeah, you are right.

Blocking on samgiles/slumber#148

We could install that particular commit/revision in case we really want to do it like this since the project looks kind of dead unfortunately :(

@humitos humitos added the Status: blocked Issue is blocked on another issue label Dec 24, 2018
@agjohnson
Copy link
Contributor

I'm also fine working around slumber for this, though the current solution is a little hacky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code Status: blocked Issue is blocked on another issue
Projects
None yet
Development

No branches or pull requests

3 participants