Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var username = "ck_????????????????????????????????????????";
- var password = "cs_????????????????????????????????????????";
- var up = username + ":" + password;
- var authHeader = "Basic " + btoa(username + ":" + password);
- WooClient.prototype.getProducts = function () {
- return $.ajax({
- url: "/myshop/wp-json/wc/v1/products",
- type: "get",
- dataType: "json",
- xhrFields: {
- withCredentials: true
- },
- beforeSend: function (xhr) {
- xhr.setRequestHeader("Authorization", authHeader);
- return true;
- }
- }).then(function (data) {
- return data;
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement