none
Media type requires a '/' character RRS feed

  • Question

  • trying to call service using PUT request but everytime getting the same response "Media type requires a '/' character"

    Wednesday, May 31, 2017 11:19 AM

All replies

  • Could you share us more information about your issue?

    Did you develop WCF OData service? What is the response type for this service? Is there any GET function? I would suggest you access the Get function in IE and capture by Fiddler to check the request and response.

    Per to this error message, I suggest you leave empty value for Accept header or the right format for response.

    If it did not work for you, it would be helpful if you could share us a simple demo which could reproduce your issue.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, June 1, 2017 2:38 AM
  • Thank you Edward for reply, i tried with empty "accept" header as you suggested. but still the response is same. 

    Before response was "Media type requires a ';' character before a parameter definition". i changed Content type to "type "/" subtype *( ";" parameter )", it resolves the issue but raises another one.....'/' character

    Thursday, June 1, 2017 11:29 AM
  • There are some settings make me confused, could you help to clear them?

    1. For a PUT request, we usually put the parameter in body or header, how did you define the WCF method which will receive parameter in URL?

    2. Content-Type is used to indicate the type for the request body, something like “application/json”, why you set it by “type “/” subtype *(“;” parameter)”? Have you seen this usage in anywhere?

    Could you share us how you define your WCF Service method? I will try to reproduce your issue at my side.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, June 2, 2017 5:09 AM
  • previously i was facing -----"Media type requires a ';' character before a parameter definition" issue. as suggested in some forums to change MIME type means content type to “type “/” subtype *(“;” parameter)”......its changed the error message from there.....the new error is 

    Media type requires a '/' character. 

    Friday, June 2, 2017 1:59 PM
  • Hi vikash,

    I have made a test with simple WCF Service, but I failed to reproduce your issue.

    Could you share us how you create such a WCF Service?

    The error message it too generic, I am afraid it is difficult to provide more helpful suggestion without reproducing your issue.

    If you have any security reason for that could not share us your project, I would suggest you create a simple project which does not contain sensitive information.

    We are glad to try to reproduce your issue, and provide any helpful suggestion.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 5, 2017 2:14 AM