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

Getting raw response #207

Closed
ghost opened this issue Oct 9, 2018 · 9 comments
Closed

Getting raw response #207

ghost opened this issue Oct 9, 2018 · 9 comments

Comments

@ghost
Copy link

ghost commented Oct 9, 2018

Hi,

is it possible to get the raw response (string / byte[]) which is not already handled / consumed anyway?

@natebosch
Copy link
Member

Do you mean getting the headers and the body all as a byte[]? No, that isn't possible as far as I know. What is the motivation?

@ghost
Copy link
Author

ghost commented Oct 10, 2018

Yes.

I am figuring out if it is possible in flutter to build a app tool for devs. Say, there are different (browser) engines, HTTP librarys and different system programming languages or dynamic ones. If you look in different channels and networks, people try to figure out, why their (HTTP) microservices works on one thing - but not o another.

Thats because of using such engines, libs and languages to build microservices or have to generate headers / data theirself. The one parses strictly RFC, the other one not. One has a good error handling, the other one is more strict. And, of course, there may be bugs.

It's a difference if you build a response with Content-Type: text/html; charset=utf-8 or content-type:text/html;charset="utf-8" (to make it really noise). So, there are many differences, like or not or \r\n or \n or \n\n or case for example.

So, with tooling, it sometimes becomes easy to check output of a service. But - thats only as this tools parses it. Without exact raw response one can waste hours or days to find an (sometimes) error.

If i have a look on a raw string response for example, i need seconds to check thousands of things. Seeing the raw (besides parsed) is like magic - you definitevely know, oups " is wrong or really a type mismatch, like "'.

If not possible, whats the nearest point to get this in flutter / dart?

You would help me a lot :)

@ghost
Copy link
Author

ghost commented Oct 16, 2018

@natebosch what do you think is best way to archive something like that? Or should i ask somewhere else? Can you help, please? :)

@natebosch
Copy link
Member

Filed dart-lang/sdk#34825

This isn't a capability that we're likely to put into package:http since it's a wrapper around the dart:io and dart:html capabilities and this would be rather specialized. In any case to even have the option of adding it here we'd need it in both dart:io and dart:html. I filed a request to add it in dart:io since that's what you'd need for flutter. Please +1 that issue and follow for updates.

Closing since there are no planned actions for this package.

@ghost
Copy link
Author

ghost commented Oct 16, 2018

Thank you very much :)

@zoechi
Copy link

zoechi commented Oct 17, 2018

@flddr Btw. that's also why I suggested to create the issue in dart-lang/sdk

@ghost
Copy link
Author

ghost commented Oct 17, 2018

@zoechi I could follow your suggestion some time later, but in that moment i was just irritated about our talk on gitter and directly closing my issued question under topic "help me writing my app"

Btw, thank you, i remember :)

@zoechi
Copy link

zoechi commented Oct 17, 2018

@flddr Sorry for that, but keeping issues open which I know they don't make sense in flutter/flutter just to not appear unfriendly, is cumbersome.
I'm experimenting with different ways how to handle that better.

@ghost
Copy link
Author

ghost commented Oct 18, 2018

@zoechi the most important thing is to answer an issue request and i would give you a compliment: you are doing this very well 👍

My bad 😉

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