Skip to content

parse_header Error trying to import adafruit_esp32spi.adafruit_esp32spi_wsgiserver #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
team3572 opened this issue Oct 2, 2020 · 4 comments

Comments

@team3572
Copy link

team3572 commented Oct 2, 2020

I'm new to the entire CircuitPython library.
Was following an online example to create a HTTP server and this line in the example is throwing an error...

import adafruit_esp32spi.adafruit_esp32spi_wsgiserver as server

Error is..

Traceback (most recent call last):
  File "code.py", line 1, in <module>
  File "adafruit_esp32spi/adafruit_esp32spi_wsgiserver.py", line 34, in <module>
ImportError: cannot import name parse_headers

I do have the adafruit_requests library installed.

But maybe I have something incorrect in my installation.
I do have other things working using CircuitPython so in general I am running code fine.

@tannewt
Copy link
Member

tannewt commented Oct 2, 2020

Oops! I think I broke this. parse_headers is not actually part of the requests API. We'll need to pull the implementation into this library. The code is here: https://github.com/adafruit/Adafruit_CircuitPython_Requests/blob/master/adafruit_requests.py#L268

Do you want to try that? You can get guidance on our Discord

@Anton-2
Copy link

Anton-2 commented Nov 12, 2020

Fixed in #115 . With this PR I was able to make a WSGI app on a MatrixPortal allowing uploading of pictures...

@tekktrik
Copy link
Member

Looking through old issues, it looks like this may be fixed?

@anecdata
Copy link
Member

Closing. The ESP32SPI WSGI server was deprecated in #167 and #181, in favor of https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants