Azure / Azure/azure-functions-python-library

HttpRequest.files performance issue

Aperta
#69 1 commento 0 reazioni 1 assegnatario Rivendicata da @Hazhzeng Vedi su GitHub
Lingua principale
Python
Stelle
179
Fork
79
Merge medio
2g 8h
PR unite (30g)
2

Descrizione

I'm attempting write a simple Azure Function that reads an XML file sent in using multipart/form-data as seen in the below curl sample (the file is about 7.5MB).
```
curl --location --request POST 'http://localhost:7071/api/HttpTrigger1' \
--header 'Content-Type: multipart/form-data' \
--form 'gpxFile=@/C:/somefile.XML'
```
When I use this line of code using the Azure Functions Python Library to access the data:
`x = req.files.get('gpxFile').stream.read().decode("utf-8")`
I'm seeing about 15 second response times.

A similar line using Flask:
`x = request.files['gpxFile'].read().decode("utf-8")`
returns in about 1.5 seconds.

Am I using the HttpRequest object incorrectly? If not, why does Flask request respond so much quicker then the Azure HttpRequest?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.