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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:00:55+00:00 2026-05-17T03:00:55+00:00

I need to call a (HTTP) REST API as as POST call – basically,

  • 0

I need to call a (HTTP) REST API as as POST call – basically, it allows me to post a message to a forum/community.

Since, there is currently no way of authenticating over the API, I need to depend on browser cookies. ie, have the user logged in to the community and then use the API calls. This means, server proxies are ruled out.

And because its a POST call, JSONP is also ruled out, even if it were supported by the API’s server.

So this POST call needs to be 100% javascript.

This JS will end up being part of a Webpart in Sharepoint so I don’t really want to complicate it with iframes.

Well?

  • 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-17T03:00:56+00:00Added an answer on May 17, 2026 at 3:00 am

    The only way to do a cross-domain POST is to script a form:

    <iframe name="iframe"></iframe>
    <form id="foo" target="iframe" method="POST" action="http://...">
        <input type="hidden" name="parameter 1" value="bar"/>
        ...
    </form>
    <script type="text/javascript">
        ...
        document.getElementById('foo').submit();
    </script>
    

    You won’t be able to read the response in the iframe due to the Same Origin Policy, but the POST will be made.

    Any forum that knows what it’s doing will reject this request. Otherwise, anyone who visited a third-party site could be made to automatically post to the forum against their will. This is known as cross-site request forgery (XSRF) and is a perennial web security problem. Most forum administrators would consider the above code hostile.

    Secure forums use an ‘anti-XSRF’ per-action token to prevent the above, essentially requiring that postings be made from the form on the site itself and not from a third-party site. Since you can’t read the document included cross-domain, you can’t pinch the token so can’t authorise a post.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to call an API with POST arguments, for example: URL = http://localhost/myAPI/
I need to make a rest api call to a website say xyx.com. It
I need to POST a REST service call and get the data it returns
i need to consume a web api, which is located here http://46.253.202.174:8080/ws-api/v1/rest/zdata/codesByJurAndUsage?jur=Boston,%20MA&usg=barber I don't
i like to preform simple facebook api call via http rest but whiteout using
I need make a GET call to a REST api which is rate limited.
I use asp.net 2 and need to consume a 3rd party HTTP GET call
I'm using jersey API for some REST web services with apache Tomcat. I need
I am sending a call to a SMS gateway using their REST API. Everything
I need to call a REST web service that provides an XML feed of

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.