Category : put

I am stuck on the following, I have a put-call designed: def put(self) -> Response: data = request.get_json() print(data) list_id = data[‘id’] print(list_id) sublist = data[‘sublist’] print(sublist) put_list = Lists.objects(id=list_id).update({"$addToSet": { "$sublist": sublist }}) return jsonify({‘result’: put_list}) Which reaches my database, prints the values I would like to use correctly. However I still receive the ..

Read more

I was using django user class and rest_framework Token class to store the user info and the token. For the same I was using serializers.ModelSerializer class. But when I am making update request(check update method) to update the user info as well as the token that I have, its giving me error. Here is serializers.py ..

Read more

I am trying to put request a base64 encoded image to the represented api shown in the sample code below . This base64 image string contains 134000 characters and it’s size is 0.24 MB or 242525 bytes. Here is the code I used. #base64 content base_content = "/y4AAQSkZJRgABAQEAYABgAAD/2wBDA………" # input parameters data = {‘mailId’:’[email protected]’,’Name’:"example",’imageBaseCode’:base_content} # ..

Read more

curl -X PUT -H ‘Content-Type: video/mp4’ -H "Content-Length: 8036821" -T "/Users/kenh/Downloads/amazing_race.mp4" "https://hootsuite-video.s3.amazonaws.com/production/3563111_6923ef29-d2bd- 4b2a-a6d2-11295411c988.mp4?AWSAccessKeyId=AKIAIHSDDN2I7V2FDJGA&Expires=1465846288&Signature=3xLFijSn02YIx6AOOjmri5Djkko%3D" Mainly I do not understand how to user -T line. Headers and URL I know. Source: Python..

Read more

I need to write same code below in Java. What is the equivalent of python code below in Java? Thanks. url = "URL" headers = {"admin_key":"0fdgdf0g64fr4h4e24z4df5xv"} data = ”'{ "request": { "status": { "name": "Closed" } } }”’ data = {‘input_data’: input_data} response = requests.put(url, headers=headers, data=data, verify=False) print(response) Source: Python..

Read more

When using flask_restful to create model ‘Video’, i used a function ‘video_exist’ to check if the id is exist of not, if already have that id, abort request class Video(Resource): def get(self,video_id): video_non_exist(video_id) return videos[video_id] def post(self,video_id): video_exist(video_id) args = video_post_args.parse_args() videos[video_id] = args return{video_id: args},203 i can still post a new data with the ..

Read more