Guest User

Untitled

a guest
Jan 20th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. addS3file (s3file: S3File, url: string, data:string): Observable<S3File> {
  2. return this.http.post<S3File>(url, s3file, httpOptions).pipe(
  3. tap((s3file: S3File) => this.log(`added s3file w/ id=${s3file.id}`)),
  4. catchError(this.handleError<S3File>('adds3file'))
  5. );
  6. }
  7.  
  8. file_path = 'screen.png'
  9. with open(file_path, 'rb') as data:
  10. files = {'file': data}
  11. url = post_data['url']
  12. request_data = post_data['fields']
  13.  
  14. r = requests.post(url, data=request_data, files=files)
Add Comment
Please, Sign In to add comment