cwrc / NERVE

Named Entity Recognition Vetting Environment
GNU General Public License v2.0
3 stars 3 forks source link

Content-Type: application/x-www-form-urlencoded return an empty response #85

Open jefferya opened 4 years ago

jefferya commented 4 years ago

CWRC-Write NERVE integration is failing, NERVE returns and empty response.

The CWRC-WRiter sends a request with headerContent-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-L86

I'll see what I can do tomorrow to:

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?

jefferya commented 4 years ago

A kludgy hotfix (PR#86) is in place as part of this issue to restore CWRC-Writer functionality.