Comments (8)
Hmm, this is kind of weird. What version of CouchDB this is? Can you somehow get the exact response, headers and content, on the HTTP level? The code in Resource._request_json()
seems to imply that if the Content-Type includes application/json
, the response content (which could well be a BytesIO
) should get decoded into a dictionary.
from couchdb-python.
The db is actually a pouchDB, but I think that should be okay. The server replies that it is version 2.0.0:
{
couchdb: "Welcome",
version: "2.0.0",
vendor: {
name: "The Apache Software Foundation"
}
}
from couchdb-python.
Debugging it a bit, the data
value (https://github.com/djc/couchdb-python/blob/master/couchdb/client.py#L511) is indeed a BytesIO
, with html content showing a 301 response:
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
And here's the header content (url removed):
> headers.items()
[('Server', 'nginx'),
('Date', 'Sun, 19 Mar 2017 19:25:17 GMT'),
('Content-Type', 'text/html'),
('Content-Length', '178'),
('Connection', 'keep-alive'),
('Location',
'https://xxxx')]
from couchdb-python.
I still really want to know the exact HTTP response, including headers.
Also, the welcome object you're showing doesn't look like PouchDB, and I'm pretty sure PouchDB does not offer a HTTP API in any case.
from couchdb-python.
I updated my above comment with the response. From what I can tell, PouchDB provides a CouchDB-compliant RESTful API
from couchdb-python.
So the Content-Type is wrong, this is why it doesn't work.
from couchdb-python.
The same commands work if I manually do a put request using requests
, so I believe this is a bug with the library. Since you closed the issue, I take that to mean you don't have an interest in fixing it?
from couchdb-python.
The Content-Type
being set to application/json
is, for all intents and purposes, part of the CouchDB API contract. As your setup doesn't seem to comply with that API contract, yes, I don't think it makes sense to change couchdb-python
to make your setup work.
from couchdb-python.
Related Issues (20)
- couchdb-dump: No python 3.5 support HOT 1
- `ViewResult` slicing with `datetime` object HOT 3
- Missing git tag for 1.1 HOT 1
- Support mango queries HOT 10
- HTTP basic auth is broken for accented characters HOT 2
- Server.version() broken for CouchDB 2.0 HOT 6
- Support CouchDB 2.0.0 HOT 10
- CouchDB 2.0 - syncing views make CouchDB hanging HOT 4
- Not url-encoding doc IDs in update handler call HOT 15
- Put Multiple Attachments HOT 1
- Bug when used with multiprocessing HOT 3
- More user friendly for HTTP Basic Auth HOT 2
- View Server Write Error: str, not bytes HOT 3
- config has moved in 2.0.0 HOT 4
- missing find() definition on Database class HOT 5
- [Mango query] Show warning when no matching index found. HOT 1
- Cant find a way to send headers in replication HOT 2
- End of Support ?= End Of Documentation HOT 2
- Cookie auth token error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from couchdb-python.