Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7183959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:06:07+00:00 2026-05-28T18:06:07+00:00

I’m trying to post to Blogger using idHTTP component, however, I’m getting HTTP/1.0 400

  • 0

I’m trying to post to Blogger using idHTTP component, however, I’m getting “HTTP/1.0 400 Bad Request” error.

procedure TForm1.Button1Click(Sender: TObject);
var request,response,req  : TStringlist;
    auth,blogid : string;
begin
blogid    := '00000000000000000000000';
request   := TStringList.Create;
response  := TStringList.Create;
req       := TStringList.Create;

IdHTTP1.Request.Connection := 'Keep-Alive';
IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
IdSSLIOHandlerSocket1.SSLOptions.Method := sslvSSLv23;

request.Clear();
request.Values['accountType'] := 'GOOGLE';
request.Values['Email']       := 'xxx@gmail.com';
request.Values['Passwd']      := 'yyy';
request.Values['service']     := 'blogger';

response.Text :=IdHTTP1.Post('https://www.google.com/accounts/ClientLogin',request);
auth := response.Values['Auth'];  //working perfectly

req.Clear();
req.Text := Memo2.Lines.Text;  //put entry into request var

IdHTTP1.Request.CustomHeaders.Clear();
IdHTTP1.Request.CustomHeaders.Add('GData-Version: 2');
//IdHTTP1.Request.CustomHeaders.Add('Authorization: GoogleLogin auth='+auth);
IdHTTP1.Request.CustomHeaders.Values['Authorization'] := 'GoogleLogin auth = '+auth;
IdHTTP1.Request.ContentType := 'application/atom+xml';

memo1.Text := IdHTTP1.Post('https://www.blogger.com/feeds/' + blogid + '/posts/default', req); // I got "HTTP/1.0 400 Bad Request" error right here.

end;

gor error on

memo1.Text := IdHTTP1.Post('https://www.blogger.com/feeds/' + blogid + '/posts/default', req);

Does anyone know what I’m doing wrong?

Any help is greatly appreciated. Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:06:07+00:00Added an answer on May 28, 2026 at 6:06 pm

    You are posting your XML data using a TStringList. Even though you are not setting the Request.ContentType to application/x-www-form-urlencoded, posting a TStrings object will always encode the data as if you did. That is likely why the server is complaining, because it will not receieve your intended XML correctly. To post XML data, you need to use a TStream instead, eg:

    procedure TForm1.Button1Click(Sender: TObject);
    var
      request, response : TStringlist;
      req : TStream;
      auth, blogid : String;
    begin
      blogid := '00000000000000000000000';
    
      IdHTTP1.Request.Connection := 'Keep-Alive';
      IdSSLIOHandlerSocket1.SSLOptions.Method := sslvSSLv23;
    
      request := TStringList.Create;
      try
        response := TStringList.Create;
        try
          request.Values['accountType'] := 'GOOGLE';
          request.Values['Email']       := 'xxx@gmail.com';
          request.Values['Passwd']      := 'yyy';
          request.Values['service']     := 'blogger';
    
          IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
          response.Text := IdHTTP1.Post('https://www.google.com/accounts/ClientLogin', request);
    
          auth := response.Values['Auth'];
        finally
          response.Free;
        end;
      finally
        request.Free;
      end;
    
      req := TMemoryStream.Create;
      try
        Memo2.Lines.SaveToStream(req);
        req.Position := 0;
    
        IdHTTP1.Request.CustomHeaders.Clear;
        IdHTTP1.Request.CustomHeaders.Values['GData-Version'] := '2';
        IdHTTP1.Request.CustomHeaders.Values['Authorization'] := 'GoogleLogin auth = ' + auth;
        IdHTTP1.Request.ContentType := 'application/atom+xml';
    
        Memo1.Text := IdHTTP1.Post('https://www.blogger.com/feeds/' + blogid + '/posts/default', req);
      finally
        req.Free;
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.