Skip to content

ArgumentException: Specified value has invalid Control characters. #3039

@GermanKuber-zz

Description

@GermanKuber-zz

Hello I am using .net core last version and I am trying to download a file through Http Request.
But I receive every time the same error :

{System.ArgumentException: Specified value has invalid Control characters.
Parameter name: value
at System.Net.HttpValidationHelpers.CheckBadHeaderValueChars(String value)
at System.Net.WebHeaderCollection.Set(String name, String value)
at System.Collections.Specialized.NameValueCollection.set_Item(String name, String value)
at System.Net.HttpWebResponse.get_Headers()
at RestSharp.Http.ExtractResponseData(HttpResponse response, HttpWebResponse webResponse)
at RestSharp.Http.<>c__DisplayClass20_0.b__0(HttpWebResponse webResponse)
at RestSharp.Http.GetRawResponseAsync(IAsyncResult result, Action1 callback) at RestSharp.Http.ResponseCallback(IAsyncResult result, Action1 callback)}

In my response I have the next parameter in the header, which I suppose that produce the error:

image

Specifically this line:
originalfilename: ANALISIS DE ADJUDICACIÒ�SN CROMATOGRAFOS NEUQUEN.docx.xlsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions