How to pass header parameters in Java?

How to pass header parameters in Java?,how to pass header parameters in java class

Mausam shayari in Hindi , Latest Mausam Hindi Shayari मौसम हिंदी शायरी मौसम स्टेटस, मौसम व्हाट्स अप स्टेटस रुत हिंदी शायरी मौसम पर शेर, मौसम की शायरी

The headers you set are written to the response that gets sent to the client, along with a Location header and a status code.

You can see in this page an example to pass http header info as a method input using @HeaderParam annotation.

You can see practically example for that solution is below:-

Naraz Girlfriend ko manane ki shayari, नाराज़ गर्लफ्रेंड को मनाने की शायरी और स्टेटस , Latest New Shayari, Status, Quotes for Girlfriend Boyfriend with Images

package com.technosuffer.restful; import javax.ws.rs.GET;import javax.ws.rs.HeaderParam;import javax.ws.rs.Path;import javax.ws.rs.core.Response; @Path("/http-header")public class HttpHeaderService {     @GET    @Path("query")    public Response queryHeaderInfo(@HeaderParam("Cache-Control") String chControl,                                        @HeaderParam("User-Cagent") String urStr){                 String tec = "Received http headers are Cache-Control: "+chControl+                        "<br>User-Cagent: "+urStr;        return Response.status(200).entity(tec).build();    } }

Post a Comment

Previous Post Next Post