@task
def constraintsuploaddoc(self, false=None):
headersc = {'content-type': 'multipart/form-data; '
'boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Length': '433', 'Accept': '*/*'}
payload = {
'blobText': '{ ID: 3, FileClass: "LogicsticsConstraints", FileDescriptor: "test", FieldName: '
'"lookup.csv" }'}
files = [
('File',
('lookup.csv', open(r"C:\Perffiles\lookup.csv",'rb'), 'text/csv'))
]
rupload = self.client.put("/api/v1/FileUpload/Upload", data=payload,
files=files,
verify=False,
headers=headersc, name="constraintsuploaddoc")
if rupload.status_code == 200:
# we got a 200 OK
rupload.success()
else:
print(rupload)
rupload.failure("Error occured")
Error:
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-415d71c9881187498929206abd2ec4ab-9f31d5c108f99944-00",
"errors":{
"": ["Failed to read the request form. Unexpected end of Stream, the
content may have already been read by another component. "]
}
}