Comments (2)
Hi @fmurray-r7. Since Jetty supports trailers, dropwizard supports them as well.
Trailers can be set through the servlet api. To do that, you'll inject the HttpServletResponse
in your resource method and set the trailers:
@GET
public String helloWorld(@Context HttpServletResponse response) {
response.setTrailerFields(() -> Map.of("Testkey", "Testvalue"));
return "Hello World!";
}
To check, if the trailers are set correctly, you can use the Jetty client:
ContentResponse response = client
.newRequest("http://localhost:8080")
.method(HttpMethod.GET)
.onResponseSuccess(response1 -> {
if (response1 instanceof HttpResponse httpResponse) {
System.out.println(httpResponse.getTrailers());
}
})
.send();
from dropwizard.
Ah, my mistake, thank you for the clarification!
from dropwizard.
Related Issues (20)
- Deserialization failures due to Afterburner HOT 1
- Server starts and stops immediately when both enableVirtualThreads and enableAdminVirtualThreads are set to true HOT 5
- delay between tests that use DropwizardExtensionsSupport HOT 2
- Logging request and response body with RequestLogFactory HOT 2
- Dependency Injection issue in AuthFilter HOT 4
- Add cache support for stale-while-revalidate HOT 1
- Redirect log output for commands other than "server" HOT 2
- Enhancement: Make Cli ArgumentParsers locale configurable HOT 6
- Enhancement: Expose `message` property in Dropwizard health functionality
- servletEnabled not working when using dropwizard-core:4.0.3 and metrics-jakarta.servlets:4.2.21
- Timing-Bug when logging once and a possible workaround HOT 6
- When will the 5.x version be released to support jetty12?
- Client connection leak with chunked and compressed responses HOT 3
- compressedMimeTypes property does not work as expected HOT 2
- DropwizardResourceConfig Logs Paths that Do Not Work HOT 2
- Upgrade Jetty version to 12.x.x HOT 3
- BouncyCastle version mismatch HOT 1
- DropwizardExtensionsSupport does not work with the Junit5 1.11 HOT 1
- Test hangs indefinitely HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropwizard.