1
0
Fork 0
mirror of https://github.com/sensebox/blockly-app synced 2025-07-01 17:00:25 +02:00

request to sketch working now

This commit is contained in:
Thiemann96 2020-02-20 16:58:48 +01:00
parent 5c7373391d
commit 6d7c9bdece
2 changed files with 9 additions and 8 deletions

View file

@ -58,13 +58,14 @@ export class LoginProvider {
async getUserSketch(token:string,id:string,ssid:string,password:string):Promise<string>{ async getUserSketch(token:string,id:string,ssid:string,password:string):Promise<string>{
let URL_sketch_final = URL_sketch+id+"/script"; let URL_sketch_final = URL_sketch+id+"/script";
console.log(URL_sketch_final) const headers = new HttpHeaders({'Authorization':"Bearer "+token})
const headers = new HttpHeaders({'Authorization':"Bearer "+token,responseType:'text'}) const params = new HttpParams({fromObject:{ssid,password}})
const params = new HttpParams({fromObject:{ const options = {
ssid, headers,
password params,
}}) 'responseType':'text'
return this.http.get(URL_sketch_final,{headers,params}) }
return this.http.get(URL_sketch_final,options)
.pipe(timeout(30000)) .pipe(timeout(30000))
.toPromise() .toPromise()
.catch(err=>{ .catch(err=>{