How to parse JSONWS remote access
This article introduces you how to analyze JSONWS remote access, the content is very detailed, interested friends can refer to, hope to be helpful to you.
JSONWS remote access $(document) .ready (function () {var username = "test@liferay.com"; var password = "test"; function auth (user, password) {var tok = user +':'+ password; var hash = btoa (tok); return "Basic" + hash } $.ajax ({url: 'http://localhost:8080/api/jsonws/user/get-user-by-id/user-id/20198', dataType: "json", type: "get", success: function (data) {alert (data);}, beforeSend: function (xhr) {xhr.setRequestHeader (' Authorization',auth (username, password)) }, complete: function () {}, error: function () {});}); javaString pathUrl = "http://localhost:8080/api/jsonws/user/get-user-by-id/user-id/20198";URL url = new URL (pathUrl); HttpURLConnection httpConn = (HttpURLConnection) url.openConnection (); String userName =" test@liferay.com "; String password =" test "; String token = userName +": "+ password String authorString = "Basic" + Base64.encodeBase64String (token.getBytes ()); httpConn.setRequestProperty ("Authorization", authorString); remarks
Auth.token.check.enabled=false / / Unvalidate
On how to parse JSONWS remote access to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.