Git Product home page Git Product logo

Comments (6)

RikkiGibson avatar RikkiGibson commented on June 18, 2024

HttpRequest requires a mimeType argument be passed when setting the request body, but this is likely to come from the @Headers annotation. Will work around it for now but we'll probably want to coalesce on a standard method for handling this.

It may be desirable to take certain standard headers and give them their own required annotations so we can ensure that a service interface method is well-formed more easily.

from autorest-clientruntime-for-java.

RikkiGibson avatar RikkiGibson commented on June 18, 2024

We will want to make a design/philosophical decision about whether an HttpRequest object can be expected to be fully formed, and not need to have default values placed for missing required headers by the time RestProxy passes it to HttpClient.sendRequestAsync.

from autorest-clientruntime-for-java.

RikkiGibson avatar RikkiGibson commented on June 18, 2024

I'm also wondering if the use of InputStream is going to force us to use blocking file I/O and how that should affect the design. I think these questions might get hashed out at the time @jianghaolu is able to pull his netty adapter into the runtime.

from autorest-clientruntime-for-java.

 avatar commented on June 18, 2024

I'm just getting to look at this, and I'm not sure that I like the idea of exposing our HttpRequest and/or HttpRequestBody classes outside of our internals. I feel that if our current annotations/annotation processing is lacking somewhere (streaming) then we should fix it there, rather than breaking our abstractions by exposing our internal data structures.
I thought that the only streaming scenario we were able to think of was streaming a file, which we already had a verbal solution for (pass in a File object and RestProxy would start streaming the file's contents as well as set the proper MIME type). Is there another scenario that has come up?

from autorest-clientruntime-for-java.

RikkiGibson avatar RikkiGibson commented on June 18, 2024

I think you’re right, although outside of this case HttpClient stuff will probably leak out of the runtime in contexts like user-defined RequestPolicies.

The file use case, which should probably be all we do for streaming until more scenarios come up, would probably be best addressed by something like what you’re describing—maybe a file path or stream, offset and length, which does whatever observable byte buffer pooling fancy thing inside. Thanks for the reminder.

from autorest-clientruntime-for-java.

RikkiGibson avatar RikkiGibson commented on June 18, 2024

This is pretty much addressed by #257

from autorest-clientruntime-for-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.