I tried for :
def baseURL = "correct url since post man works " ;
def url = new java.net.URL(baseURL);
def requestMethod = "POST";
URLConnection connection = url.openConnection();
connection.setRequestProperty("Authorization", "Basic copied from postman, it is correct");
connection.setRequestMethod(requestMethod);
connection.setRequestProperty("Content-Type", "application/xml");
connection.setRequestProperty("Accept", "application/xml");
connection.connect();
For me:
connection.setRequestMethod(requestMethod);
gives me a problem saying that method: setRequestMethod could not be found.
I tried rest client as well, there exception gets raised but does not throw exact error
Kindly help for same.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.