restEndPoint=properties.getProperty("cmsRestapiAddress"); URL url = new URL(restEndPoint); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod(serviceType); Date currentDate = new Date(); Map<String,Object> params = new HashMap<String, Object>(); params.put("interactionDate", currentDate.toString()); String timestamp=generateCode(); //params.put("token", new String(KeyUtils.generateToken(timestamp))); params.put("timestamp", timestamp);
StringBuilder postData = new StringBuilder(); for (Map.Entry<String,Object> param : params.entrySet()) { if (postData.length() != 0) postData.append('&'); postData.append(URLEncoder.encode(param.getKey(), "UTF-8")); postData.append('='); postData.append(URLEncoder.encode(String.valueOf(param.getValue()), "UTF-8")); } byte[] postDataBytes = postData.toString().getBytes("UTF-8"); conn.setRequestProperty("Accept", serviceReturntype); conn.setDoOutput(true);
conn.getOutputStream().write(postDataBytes);
if (conn.getResponseCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode()); } BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream())));
cmsRestapiAddress=http\://localhost\:8080/site/api
--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.
[main] INFO util.StringTemplateUtilsCms - StringTemplateUtilsCms::getTemplateList::Cms Mount point URL :http://localhost:8080/site/api/documents[main] ERROR util.StringTemplateUtilsCms - Exception in CMSRestAPI because : Failed : HTTP error code : 405[main] ERROR org.springframework.batch.core.step.AbstractStep - Encountered an error executing the step
--
Hippo Community Group: The place for all discussions and announcements about Hippo CMS (and HST, repository etc. etc.)
To post to this group, send email to hippo-c...@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.