package com.javahonk;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.UriInfo;


@Path("/user")
public class HelloWorld {
	
	 @GET
	 @Path("/helloWorld")
	 @Produces(MediaType.TEXT_HTML)
	 public String helloWorld(@Context UriInfo uriInfo) {
		 
		MultivaluedMap<String, String> queryParams = uriInfo.getQueryParameters(); 
	    String name = queryParams.getFirst("name");
	    String age = queryParams.getFirst("age");
	    String country = queryParams.getFirst("country");
	    String zip = queryParams.getFirst("zip");
	 
		return "<html> " + "<title>" + "Hello World!" + "</title>"+ "<h2><body>Below user added:</br></br>"+
		"Name:  "+name+" </br>"+
		"Age:  "+age+" </br>"+
		"Coutry:  "+country+"</br>"+
		"Zip:  "+zip+"</br></body></h2>" + "</html> ";
	 
	}
	
}