Skip to content

Content-Type header ignored (UnsupportedMediaType returned) #32

@sanzoghenzo

Description

@sanzoghenzo

Expected Behavior

I'm trying to use Dynaweb to talk to a RESTheart docker instance, in order to read/write to a mongoDB.

Following this (little outdated) tutorial, I'm trying to create a collection via
PUT http://localhost:8080/restheart/movies with JSON body {"desc": "my favorite movies"}.

The equivalent (working) curl call is:

curl -i -H "Content-Type: application/json" -X PUT http://localhost/restheart/movies -d '{"desc": "my favorite movies"}'

I'm expecting that using the example 5 and changing the url, endpoint, json string and method would work without issues.

Actual Behavior

The WebResponse returns a 415 UnsupportedMediaType status code, with content

{
  "http status code": 415,
  "http status description": "Unsupported Media Type",
  "message": "Content-Type must be either: application/hal+json or application/json"
}

It seems that Content-Type is not correctly passed as header.

Steps to Reproduce the Problem

  1. open the example 5 in dynamo studio (I also changed the execution type to manual)
  2. change the url to http://localhost:8080/restheart (the url pointing to the restheart instance+database name)
  3. change the endpoint to movies
  4. change the json string to {"desc": "my favorite movies"}
  5. change the metod to PUT
  6. run the project

Specifications

- DynaWeb: 1.0.3
- Dynamo : Dynamo Studio 1.3.3.4111
- Operating system :  Windows 10 1809
- .NET :  4.6.2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions