Question: i tried this way but geting a bad request 

```
  var id = localStorage.getItem('sessionId');
     $.ajax({
        method:'POST',
        url:'video/ratings?sessionId='+id+'',
        data:{"videoId":"5757e6e41b0a244b256ac1d7","rating":"5"},
        success:function(data){
        console.log(data); 
        } 
     }

 );

```

> 
> these are inputs i have given with
> 
> 
> 
> ```
> (required)queryurl:/video/ratings?sessionId=CqqAfowuZLzXHyViPaYzzyOU3dGPCFaG
> input:{"videoId":"5757e6e41b0a244b256ac1d7","rating":"5"}
> 
> ```
> 
>

Answer: 
The answer was contained in the code from the link posted by Haukinger:

```
object actual = 
    container.Resolve<IDatarecordSerializer>(
        new ParameterOverride(
            "type", 
             new InjectionParameter(typeof(string))
        )
    );

```
In fact, Unity explicitly treats `Type` values in a `ParameterOverride` not as literal values but as types that should themselves be resolved. And then it tries to resolve an instance of type `string` and fails, obviously.

`ParameterOverride` stores the value in a `InjectionParameterValue` instance, which it turn interpretes `Type` different from other types.

See lines 77ff in [InjectionParameterValue.cs](https://github.com/unitycontainer/unity/blob/master/source/Src/Unity-CoreClr/Injection/InjectionParameterValue.cs)

I'd try creating an issue with Unity, but I guess it's more of a feature than a bug...

In the meantime, hide the `Type` from Unity by changing the type of the dependency to something like this:

```
class HiddenType
{
    public Type Type
    {
        get;
    }

    public HiddenType( Type type )
    {
        Type = type;
    }
}

```