Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addS3file (s3file: S3File, url: string, data:string): Observable<S3File> {
- return this.http.post<S3File>(url, s3file, httpOptions).pipe(
- tap((s3file: S3File) => this.log(`added s3file w/ id=${s3file.id}`)),
- catchError(this.handleError<S3File>('adds3file'))
- );
- }
- file_path = 'screen.png'
- with open(file_path, 'rb') as data:
- files = {'file': data}
- url = post_data['url']
- request_data = post_data['fields']
- r = requests.post(url, data=request_data, files=files)
Add Comment
Please, Sign In to add comment