TypeError: Object of type FileStorage is not JSON serializable - json-serializable

TypeError: Object of type FileStorage is not JSON serializable
when i am trying to send file to the flask backend it showes me this error both from the frontend and postman in the terminal
also the post man
i have tried to change the file to base64 but it doesnt work

Related

TypeError: Cannot read properties of undefined (reading 'name') in Postman

I just tried to test the server with Postman and the above error occurred. Get request is properly worked but Post request is not working properly. My server.js file code is shown below.
Vs code server.js file:
Vs Code Terminal:
Postman Post Request:
Postman body after sending the Post Request

Using tf.saved_model.save() to save a model to GCS bucket from local

I'm trying to save a tensorflow model to a GCS bucket from my local machine(Jupyter Notebook). I do have the google cloud storage credentails json. How do I save the model to the bucket since Tensorflow supports gcs links in saved_model
I used it as follows:
tf.saved_model.save(model, "gs://your_bucket")
This throws the following error:
PermissionDeniedError: Error executing an HTTP request: HTTP response code 401 with body
Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object.",
How do I use my credentials json I have ?
Edit:
How to authenticate tf.saved_model.save() before calling it.
I have the following service account credentials as a json.
In the Python Script
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]='credentials.json'
and then
model.save('gs://your_model_path_in_bucket')
works

Getting Unsupported Media Type in Postman response while sending GraphQL API mock request data

I am working on an application with graphQL and spring boot framework. Here I am using GraphQL's Schema-first approach to write my schema details. In my scenario, I need to update the user profile image using GraphQL. I am using my test client as postman and I have attached the mock request structure as well. When I send my mock data to the server, I am receiving '415 - Unsupported Media Type' error response. Can someone please guide me on this. ?
Also, please suggest if I have to use multipart file to get the uploaded file at the server.
Thanks in advance.

Call API via uri module in Ansible

While calling the api <towername>/api/v2/job_templates/<templ_name>/launch via uri module on the localhost, I am getting error as
Status code was 500 and not [201]: HTTP Error 500: Internal Server Error
I am passing the below attributes in the playbook:
method, validate_certs,status_code, return_content, body_format,user, password, force_basic_auth.
Please advise
Body attribute was missing, once I updated, it worked fine.

Couldn't call aws api gateway from postman

I have created an api in amazon api gateway service with s3 proxy, and created a method post to upload a file to s3 using the document. Deployed the API and then using that url i tried to call the api from postman. But i couldn't post the file and it returns an error 'missing authentication token'.
I set authorization as NONE.
Then it returns an Unexpected "<" error.
Ah, okay. S3 only supports POST from an HTML form, which is why you see the error where it is expecting multipart formdata.
The method you need to use is PUT, instead of POST. PUT requires an item path, so you'll need to change the resource path to have a bucket and key, or get those from other places.
I have some more info on how to set this up in upload binary from api gateway to S3 bucket
It sounds like the document you're uploading isn't JSON. By default, API Gateway expects UTF-8 encoded JSON.
What content type are you sending with your Postman request?