Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- type: "POST",
- url: "http://localhost:54025/Api.asmx/Login",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- xhrFields: { withCredentials: true },
- crossDomain: true,
- data: "{ 'userName':'" + userName + "','password':'" + password + "' }",
- success: ReceivedLoginResponse,
- error: function (jqXHR, textStatus, errorThrown) {
- console.error("jqXHR: %s rntextStatus: %s rnerrorThrown:%s", jqXHR.responseText, textStatus, errorThrown);
- }
- });
- var nowDate = new Date();
- var currentStartDate = new Date(nowDate.getFullYear(), nowDate.getMonth(), 1);
- var currentEndDate = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate());
- $.ajax({
- type: "POST",
- url: "http://localhost:54025/Api.asmx/GetMeasurePointConsumption",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- xhrFields: { withCredentials: true },
- crossDomain: true,
- data: "{ 'measurePointId':" + measurePointId + ", 'startDate':'" + currentStartDate.toJSON() + "','endDate':'" + currentEndDate.toJSON() + "', 'dataType': 'Day' }",
- success: ReceivedMeasurePointConsumptionResponse,
- error: function (jqXHR, textStatus, errorThrown) {
- }
- });
- syntax = "proto3";
- package api;
- import "google/api/annotations.proto";
- service Authentication {
- // This rpc is used to check a valid user from other applications.
- rpc Login(LoginRequest) returns (LoginResponse) {
- option (google.api.http) = {
- post : "/Api.asmx/Login"
- body : "*"
- };
- option (google.api.cors) = {
- enable: true
- };
- }
- }
- message LoginRequest {
- string userName = 1;
- string password = 2;
- }
- message LoginResponse {
- ???? cookie ???
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement