Can't set language in multilogin selenium

RaeAly

Registered Member
Joined
May 26, 2018
Messages
71
Reaction score
22
When I try to set language when creating a profile, I get a response saying "request body is missing".
The only way I can get it to work is if I specify all of the navigator settings which I'd like to avoid. I contacted support and was told to try creating a JSON object and adding it to my request body but that gives me the same response. Anyone know how I can fix this?

Code:
            var restClientCreate = new RestClient(mlaCreateURL);
            var requestCreate = new RestRequest(Method.POST);

            dynamic jsonObject = new JObject();
            jsonObject.Name = "language";
            jsonObject.Value = "en-US,en;q=0.8";
            String jsonRequestString = "{\"name\": \"TESTJSON\", \"browser\": \"mimic\", \"os\": \"win\", \"network\": { \"proxy\": { \"type\": \"HTTP\", \"host\": \"" + proxi + "\", \"port\": \"" + proxiport + "\", \"username\": \"" + proxyUsername + "\", \"password\": \"" + proxyPassword + "\"}, \"dns\": null }}" + jsonObject;
            requestCreate.AddHeader("Content-Type", "application/json");
            requestCreate.AddParameter("application/json", jsonRequestString, ParameterType.RequestBody);
            var response = restClientCreate.Execute(requestCreate);
 
I accidentally copied the code wrong.
Code:
            var restClientCreate = new RestClient(mlaCreateURL);
            var requestCreate = new RestRequest(Method.POST);

            dynamic jsonObject = new JObject();
            jsonObject.Name = "language";
            jsonObject.Value = "en-US,en;q=0.8";
            String jsonRequestString = "{\"name\": \"TEST\", \"browser\": \"mimic\", \"os\": \"win\", \"network\": { \"proxy\": { \"type\": \"HTTP\", \"host\": \"192.168.1.1\", \"port\": \"1080\", \"username\": \"username\", \"password\": \"password\" }, \"dns\": null }}" + jsonObject;
            requestCreate.AddHeader("Content-Type", "application/json");
            requestCreate.AddParameter("application/json", jsonRequestString, ParameterType.RequestBody);
            var response = restClientCreate.Execute(requestCreate);
 
Back
Top