Code example for HttpRequestBase

Methods: setHeader

	 * @param request the request 
	 * @param useragent the useragent 
	 * @return the http request base 
	private HttpRequestBase setPostHeaders(HttpRequestBase request, String useragent) {
		request.setHeader("User-Agent", useragent);
		request.setHeader("Accept", sDataFormat);
		request.setHeader("Content-type", sDataFormat);
		return request; 
	 * Throw http status exception. 
	 * @param statusCode the status code 
	 * @throws HTTPStatusException the hTTP status exception 
	private void throwHttpStatusException(int statusCode) throws HTTPStatusException{
		switch (statusCode) {
Experience pair programming with AI  Get Codota for Java