Skip to content

Can't use specific Content-Type for oneM2M platform #298

@thinksomuch

Description

@thinksomuch

Hi,

Can't use specific Content-Type for oneM2M platform such as 'application/vnd.onem2m-res+json;ty=4'.
Failed with following stack trace.

  • Version : 4.5.0.0

  • Request headers

Accept: application/json
X-M2M-RI: 12345
X-M2M-Origin: SOrigin
Content-Type: application/vnd.onem2m-res+json;ty=4
  • Stack trace
The format of value 'application/vnd.onem2m-res+json;ty=4' is invalid.
   at System.Net.Http.Headers.MediaTypeHeaderValue.CheckMediaTypeFormat(String, String) + 0xcf
   at System.Net.Http.StringContent..ctor(String, Encoding, String) + 0x5e
   at Nightingale.Core.Client.Builders.BodyBuilder.<SetBody>d__4.MoveNext() + 0x1cc
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult() + 0xb
   at Nightingale.Core.Client.NightingaleClient.<ToHttpMessage>d__10.MoveNext() + 0x2c9
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at Nightingale.Core.Client.NightingaleClient.<SendAsync>d__8.MoveNext() + 0x153
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x21
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task) + 0x70
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task) + 0x38
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task) + 0x17
   at Nightingale.Core.Services.RequestSender.<SendRequestAsync>d__5.MoveNext() + 0x156

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions