Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <body>
- <button>Send request</button>
- <pre></pre>
- <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
- <script type="text/javascript">
- var username = 'ShopAccount.IWNetIneco\\test';
- var password = 'test';
- var precode = 'F';
- var code = '136258';
- var url = 'http://ineco.synology.me/IWNet/ShopService.svc/GetAvailabilityA?precode=\'' + precode + '\'&code=\'' + code + '\'&deposit=\'01\'&$format=json';
- $(document).ready(function() {
- $('button').click(function() {
- $('pre').html('loading...');
- $.ajax({
- dataType: 'json',
- url: url,
- type: 'GET',
- withCredentials: true,
- headers: {
- Authorization: 'Basic ' + btoa(username + ':' + password)
- }
- }).done(function(data) {
- $('pre').html(JSON.stringify(data));
- }).fail(function(err) {
- $('pre').html(err.responseText);
- });
- });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement