[Fixed]-TypeError while uploading image using REST api in OpenShift V3

1👍

First of all I would say thanks to @Raz. Actually the tool POSTMAN caused the issue. I tested the OpenShift-v3 api using Python’s Request library. It’s worked 🙂

Code I used;

import requests
from requests.auth import HTTPBasicAuth

url = 'http://django-psql-persistent-sampledjangoex.44fs.preview.openshiftapps.com/myapp/sample/'
filess = {'image': open('sampleImage.png', 'rb')}
r = requests.post(url,data={'name': 'value1', 'number': 12573474},auth=HTTPBasicAuth('admin', 'admin'),files=filess)

Leave a comment