jimbocoin on Nostr: Question about #Nostr NIP-11: The NIP specifies that relays should respond with the ...
Question about #Nostr NIP-11:
The NIP specifies that relays should respond with the relay document when receiving a request with the 'Accept' header set to 'application/nostr+json'.
Should the response have a 'Content-Type' header of 'application/nostr+json' also? OR should the 'Content-Type' be the simpler 'application/json'.
My guess would be the former. The HTTP client said it would Accept 'application/nostr+json', so it makes sense to send a Content Type of 'application/nostr+json'. However, I'm finding that some tools don't recognize the 'application/nostr+json' content type header.
In my case, I'm using the MockResponse class from the 'node-mocks-http' npm package. The response._isJSON() method returns true for 'application/json' but false for 'application/nostr+json'.
https://github.com/nostr-protocol/nips/blob/master/11.md
The NIP specifies that relays should respond with the relay document when receiving a request with the 'Accept' header set to 'application/nostr+json'.
Should the response have a 'Content-Type' header of 'application/nostr+json' also? OR should the 'Content-Type' be the simpler 'application/json'.
My guess would be the former. The HTTP client said it would Accept 'application/nostr+json', so it makes sense to send a Content Type of 'application/nostr+json'. However, I'm finding that some tools don't recognize the 'application/nostr+json' content type header.
In my case, I'm using the MockResponse class from the 'node-mocks-http' npm package. The response._isJSON() method returns true for 'application/json' but false for 'application/nostr+json'.
https://github.com/nostr-protocol/nips/blob/master/11.md