Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: http encoding for http post


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Nov 9, 2017 9:01 AM Last Post By: Remy Lebeau (Te...
Fuandi Hartanto

Posts: 4
Registered: 7/16/14
http encoding for http post  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 9, 2017 1:35 AM
hi all, how to do proper http encoding for my http post header, params, etc ?
are these codes below correct ?

with IdHTTP1 do
begin

Request.CharSet:= 'UTF-8';
Request.CustomHeaders.Add('just_id: odfeorieorieojsdf');

Params.AddFormField('data','{"name": "hello"}','utf-8','application/json');

Post(TIdURI.URLEncode('https://xxx.xxx.xxx./doc'), Params, aStream);

end;

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: http encoding for http post  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 9, 2017 9:01 AM   in response to: Fuandi Hartanto in response to: Fuandi Hartanto
Fuandi Hartanto wrote:

hi all, how to do proper http encoding for my http post header,
params, etc ?

For the most part, TIdHTTP handles that for you.

are these codes below correct ?

Yes. Why do you think otherwise? Are you having a particular problem?

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02