[x] hotfix allowing CWRC-Writer's existing approach to function for application/x-www-form-urlencoded with a JSON blob (PR #86 )
[x] improve the error handling to report back if the content type is unsupported
[x] update documentation to describe proper content types (PR #86)
[ ] improve the logic for handling content types (see below discussion).
The current version of NERVE handles:
blob of JSON in the form {"document":"...xml..."} for Content-Type: application/json
or blob of XML for Content-Type: text/xml
To me, `application/x-www-form-urlencoded doesn't align with what I think of the blob that CWRC-Writer is sending to NERVE (i.e. not form). Am I wrong here?
If I'm misguided, I can make `application/x-www-form-urlencoded equivalent to application/json
If we should clean-up then I can add a section for `application/x-www-form-urlencoded with the output from CWRC-Writer changed to be a form with a document parameter containing XML doc or JSON Blog. Or use one of the other content types described in the readme or wiki (e.g., text/xml or application/json)?
CWRC-Write NERVE integration is failing, NERVE returns and empty response.
The CWRC-WRiter sends a request with header
Content-Type: application/x-www-form-urlencoded
and a JSON blob.The
Content-Type: application/x-www-form-urlencoded
is ignored by NERVE. See the following if/else block: https://github.com/cwrc/NERVE/blob/no-shade/Service/src/main/java/ca/sharcnet/nerve/scriber/service/EncoderNERService.java#L69-L86I'll see what I can do tomorrow to:
application/x-www-form-urlencoded
with a JSON blob (PR #86 )The current version of NERVE handles:
To me, `application/x-www-form-urlencoded doesn't align with what I think of the blob that CWRC-Writer is sending to NERVE (i.e. not form). Am I wrong here?
If I'm misguided, I can make `application/x-www-form-urlencoded equivalent to application/json
If we should clean-up then I can add a section for `application/x-www-form-urlencoded with the output from CWRC-Writer changed to be a form with a document parameter containing XML doc or JSON Blog. Or use one of the other content types described in the readme or wiki (e.g., text/xml or application/json)?
Thoughts?