java - How should I set a HttpURLConnection to be the same as a HttpServletRequest? -


i have server, , want forward requests other server (maybe modifications).

i use httpurlconnection connect second server (from first server). can lot of information httpservletrequest, example:

  • getattributenames -> getattribute
  • getheadernames -> getheader
  • getparameternames -> getparameter
  • getquerystring
  • getreader (for body)

but httpurlconnection can setrequestproperty(key, value). don't know whats different between attributes, headers, paramteres.

how should set httpurlconnection same httpservletrequest?

what information need "copy" or "clone" request?

should attributes, headers, parameters , querystrings request , set of them setrequestproperty(key, value)?


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -