Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public appointmentExistsHeadAppointmentsid(id: string, extraHttpRequestParams?: any): Observable {
const path = this.basePath + `/appointments/${id}`;
let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.values()); // https://github.com/angular/angular/issues/6845
// verify required parameter 'id' is not null or undefined
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling appointmentExistsHeadAppointmentsid.');
}
// to determine the Content-Type header
let consumes: string[] = [
'application/json',
'application/x-www-form-urlencoded',
'application/xml',
'text/xml'
];
// to determine the Accept header
let produces: string[] = [
'application/json',
getRequestOptionArgs(options?: RequestOptionsArgs): RequestOptionsArgs {
if (options == null) {
options = new RequestOptions();
}
if (options.headers == null) {
options.headers = new Headers();
}
// ADD user AUTH
let sessionToken = this._authStore.getSessionToken();
if (sessionToken) {
options.headers.append(this._authStore.localStorageSessionKey, sessionToken);
} else {
let user = this._authStore.getUser();
if (user != null) {
options.headers.append('Authorization', 'Basic ' + user.token);
}
}
return options;
}
}
cloudmersiveDetect(form: FormGroup) {
const headers = new Headers({
'ApiKey': '59710ec3-24ee-4d4c-a90e-efb6170e2f50',
});
const options = new RequestOptions({
headers: headers
});
console.log("cloudmersiveDetect");
console.log(this.http.post("https://api.cloudmersive.com/image/recognize/describe", form ,options).map(res => res.json()));
return this.http.post("https://api.cloudmersive.com/image/recognize/describe", form ,options).map(res => res.json());
}
public postHeaders() {
const headers = new Headers();
headers.append('Content-Type', 'application/json');
headers.append('Accept', 'application/json');
return headers;
}
getdata() {
this.UserService.presentLoadingDefault();
let url = "https://www.devonhello.com/chihu2/share";
var headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');
this.http.post(url, "len=" + this.data.length, {
headers: headers
})
.subscribe((res) => {
this.data = this.data.concat(res.json());
this.UserService.presentLoadingDismiss();
if( this._refresher ){
this._refresher.complete();
}
});
}
public getStageLog(id: number) {
let url = `${STAGE34_API_BASE}/stages/${id}/log/`;
let headers = new Headers();
this.setAuthorizationHeader(headers);
return this.http.get(url, { headers: headers })
.toPromise()
.then(response => response.json().data)
.catch(this.handleError);
}
protected getDefaultHeaders(): Headers {
const defaultHeaders = new Headers;
const rawDefaultHeaders = this.getRawDefaultHeaders();
for (let name in rawDefaultHeaders) {
if (rawDefaultHeaders.hasOwnProperty(name)) {
defaultHeaders.append(name, rawDefaultHeaders[name]);
}
}
return defaultHeaders;
}
login(username: string, password: string): Promise {
var headers = new Headers();
headers.append('Authorization', 'Basic ' +
btoa(username + ':' + password));
return this.http.get(this.baseUrl + this.executionEndpoint, { headers: headers })
.toPromise()
.then(response => this.loginHandler(username, headers, response))
.catch(this.handleError);
}
getlist() {
let url = "https://www.devonhello.com/chihu2/answer_list";
var headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');
this.http.post(url, "id=" + this._id, {
headers: headers
})
.subscribe((res) => {
this.items = res.json();
});
}
deleteProject(id: string, token: string) {
let headers = new Headers();
headers.append('Accept', 'application/json')
headers.append('Bearer-token', token);
return this.http.delete(environment.apiUrl + '/v1/project/id/' + id, { headers: headers });
}
}