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 6384119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:44:07+00:00 2026-05-25T02:44:07+00:00

Did anyone try to make access to api.php?action=parse&text= page with the POST request? on

  • 0

Did anyone try to make access to “api.php?action=parse&text=” page with the POST request?

on the wiki documentation I have found that it’s possible to convert wiki text to HTML. It works pretty good with GET request, but as I can understand has restriction on the text’s length, so I’ve tried to do this through the POST. But unfortunately without any success… I get error message:

The remote server returned an error: (417) Expectation failed.

here is the code in C# that I use for the request:

StringBuilder postData = new StringBuilder();
foreach(var param in parameters)
{
    if (postData.Length > 0)
        postData.Append("&");

    postData.AppendFormat("{0}={1}", param.Key, EncodeUrl(param.Value));
}
byte[] data = Encoding.UTF8.GetBytes(postData.ToString());

HttpWebRequest rq = (HttpWebRequest)WebRequest.Create(wiki.WikiURI + "/" + pgname);
rq.UserAgent = "Test Wiki Access" + Utils.Version.ToString();
rq.ContentType = "application/x-www-form-urlencoded";
rq.Method = "POST";
rq.ContentLength = data.Length;
Stream stream = rq.GetRequestStream();

stream.Write(data, 0, data.Length);
stream.Flush();
stream.Close();

string res = new StreamReader(rq.GetResponse().GetResponseStream(), Encoding.UTF8)
    .ReadToEnd();

Just wondering is it the problem in my code or that page doesn’t support POST requests at all? Did anyone try to do the same?

Thanks in advance for any suggestion,
Alex

  • 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-25T02:44:08+00:00Added an answer on May 25, 2026 at 2:44 am

    Per the API FAQ:

    Why does my API call on Wikimedia wikis just return an HTML error?

    If you use API calls with POST requests make sure that these requests don’t use Content-Type: multipart/form-data. This happens for instance if you use CURL to access the API and you pass your POST parameters as an array. The Squid proxy servers which are used at frontend servers at the Wikimedia wiki farm don’t handle that correctly, thus an error is returned.

    Instead, use the “value1=key1&value2=key2…” notation to pass the parameters as a string, similar to GET requests.

    On other wikis which you access directly it doesn’t make a difference.

    What that means is that you need to add the following:

    rq.ContentType = "application/x-www-form-urlencoded";
    

    EDIT: The above is required for the query to work properly, but it’s not what’s causing the error. That’s the fact that .Net adds a Expect: 100-continue header by default, which doesn’t work with Wikipedia for some reason. To fix that add the following line before you make a request for the first itme:

    ServicePointManager.Expect100Continue = false;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Did anyone try that feature and has some feedback? Or Does anyone know some
Did anyone try to read programmatically an Alibre Design CAD file? I see that
Did anyone of you ever find a way of getting the Microsoft Report Viewer
Did anyone tried to customize the window in which the quicktime is playing video?
Has anyone successfully talked profibus from a .NET application? If you did, what device/card
Does anyone here know SVG? If so, how did you learn it? Any books/tutorial
Does anyone have any thoughts on this method? I have did some performance testing
Does anyone know what pg_catalog.setval does? I just did a dump off a PostgreSQL
Has anyone integrated an iPhone application with a Shibboleth Identity Provider? Googling did not
I did a little research and I didn't find a way, anyone know? c#

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.