org.kuali.ole.docstore.discovery.util
Class HttpPostUtil

java.lang.Object
  extended by org.kuali.ole.docstore.discovery.util.HttpPostUtil

public class HttpPostUtil
extends Object

Utility class for simulating an HTTP POST request.


Constructor Summary
HttpPostUtil()
           
 
Method Summary
static String postData(String target, String content)
          Submits an HTTP POST request to the given target with the given request parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpPostUtil

public HttpPostUtil()
Method Detail

postData

public static String postData(String target,
                              String content)
                       throws Exception
Submits an HTTP POST request to the given target with the given request parameters.

Parameters:
target - url
content - of request parameters
Returns:
the response
Throws:
Exception - Usage: String target = "http://localhost:8080/OLE-DocSearch/select/"; String content = "q=(ModifyingAgency:iul)&facet=true&facet.field=Price_f&facet.query=Price_f:[1 TO 50]&facet.query=Price_f:[51 TO 100]&facet.query=Price_f:[101 TO 200]&facet.query=Price_f:[201 TO 500]&facet.field=r_name_facetLetter&facet.query=r_name_facetLetter:[A TO C]&facet.query=r_name_facetLetter:[D TO F]&facet.query=r_name_facetLetter:[G TO I]&facet.query=r_name_facetLetter:[J TO L]&facet.query=r_name_facetLetter:[M TO O]&facet.query=r_name_facetLetter:[P TO R]&facet.query=r_name_facetLetter:[S TO U]&facet.query=r_name_facetLetter:[V TO Z]&facet.field=YearOfPublication&facet.query=YearOfPublication:[1900 TO 1950]&facet.query=YearOfPublication:[1951 TO 2000]&facet.query=YearOfPublication:[2000 TO 2011]&facet.field=r_NameOfPublisher_facetLetter&facet.query=r_NameOfPublisher_facetLetter:[A TO C]&facet.query=r_NameOfPublisher_facetLetter:[D TO F]&facet.query=r_NameOfPublisher_facetLetter:[G TO I]&facet.query=r_NameOfPublisher_facetLetter:[J TO L]&facet.query=r_NameOfPublisher_facetLetter:[M TO O]&facet.query=r_NameOfPublisher_facetLetter:[P TO R]&facet.query=r_NameOfPublisher_facetLetter:[S TO U]&facet.query=r_NameOfPublisher_facetLetter:[V TO Z]&facet.field=r_AddedEntryPersonalName_facetLetter&facet.query=r_AddedEntryPersonalName_facetLetter:[A TO C]&facet.query=r_AddedEntryPersonalName_facetLetter:[D TO F]&facet.query=r_AddedEntryPersonalName_facetLetter:[G TO I]&facet.query=r_AddedEntryPersonalName_facetLetter:[J TO L]&facet.query=r_AddedEntryPersonalName_facetLetter:[M TO O]&facet.query=r_AddedEntryPersonalName_facetLetter:[P TO R]&facet.query=r_AddedEntryPersonalName_facetLetter:[S TO U]&facet.query=r_AddedEntryPersonalName_facetLetter:[V TO Z]&wt=xslt&tr=response.xsl&hl.fl=ModifyingAgency,MainEntryPersonalName,FullerFormOfName,DatesAssociatedWithName,Title,RemainderOfTitle,StatementOfResponsibility,PlaceOfPublication,NameOfPublisher,DateOfPublication,Extent,Dimentions,GeneralNote,TopicalTermorgeographicnameElement,GeneralSubdivision,CorporateNameJurisdictionNameEntryElement,SubordinateUnit,AddedEntryPersonalName,999_i,999_p,999_u,ISBN,ISSN&&hl=true"; String solrResponse = HttpPostUtil.postData(target, content);


Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.