how to assign data to​.http.Mess​ageBody object?

8 views (last 30 days)
I am trying to assign data to object, and 'Content-Type' set to 'application/x-www-form-urlencoded; charset=utf-8', while creating httpclient for a server. does anybody know or can give examples about how to assign data to object? I want to assign in format of name value pair since I need to assign userName and Password?

Accepted Answer

Prashanth Ramesh
Prashanth Ramesh on 18 Oct 2018
You should be able to assign data to in the following way:
>> request =;
>> request.Method =;
>> request.Body ='username=myusername&password=mY_S3cr3t_pA55w0rd!');
>> request.Header ='application/x-www-form-urlencoded;charset=utf-8');
>> response = request.send('https://my_url/login')

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by