It's all about the answers!

Ask a question

Creating a SNAPSHOT for RQM using REST API

Ajith O M (214) | asked Feb 04 '19, 12:13 a.m.

 Dear Team,

 I have tried creating snapshot using REST API and SNAPSHOT as HTTP method in Postman/Rest client and its working fine and creating snapshots as expected. But how do I implement Non-standard/Custom HTTP method SNAPSHOT in java. How do I do create custom HTTP method SNAPSHOT and incorporate with http client. Is there any jar file that could do this for me ? I have Apache webdav for propfind method which is used to get the snapshots. Similarly,how do i implement for HTTP method SNAPSHOT. 

In this document : , it says about Non-standard HTTP method requiring a HTTP client that support the HTTP  SNAPSHOT  method.
How do I implement this ? 

Please help ! 

Ajith O M commented Feb 04 '19, 1:01 a.m.

 Request Body : 

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
        <ns3:title>TC3 Snapshot 1</ns3:title> 

Accepted answer

permanent link
Paul Slauenwhite (8.3k12) | answered Feb 04 '19, 6:25 a.m.
edited Feb 04 '19, 7:33 a.m.

This is more of a Java question rather than a RQM question.  

You can override the HTTP method type for your HTTP client library and implement your own SNAPSHOT HTTP method type.  For example (Apache Commons - org.apache.commons.httpclient.methods.EntityEnclosingMethod):

protected class SnapshotMethod extends EntityEnclosingMethod {

public SnapshotMethod(String uri) throws IllegalArgumentException, IllegalStateException {

public String getName() {
return "SNAPSHOT";
<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #646464} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #2a00ff} span.s1 {color: #7f0055} span.s2 {text-decoration: underline} span.s3 {color: #6a3e3e} span.s4 {color: #000000} span.Apple-tab-span {white-space:pre} </style>

Ajith O M selected this answer as the correct answer

Ajith O M commented Feb 04 '19, 7:20 a.m. | edited Feb 04 '19, 7:40 a.m.
Thanks a lot.

Your answer

Register or to post your answer.