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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:34:43+00:00 2026-06-02T13:34:43+00:00

I really hope someone can help me along with this one… I need to

  • 0

I really hope someone can help me along with this one…

I need to do an xml POST to RESTful API using php, but I have absolutely no clue where to start.

I can build the xml, but how do I post the it? I cant use cURL library.

  • 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-06-02T13:34:48+00:00Added an answer on June 2, 2026 at 1:34 pm

    You can use file_get_contents(). allow_url_fopen must be set on php.ini.

    $context = stream_context_create(array('http'=>array(
        'method' => 'POST'
        'content' => $myXMLBody
    )));
    $returnData = file_get_contents('http://example.com/restfulapi', false, $context);
    

    This is possible because PHP abstracts stream manipulation with his own wrappers. Setting a context to stream manipulation functions (like file_get_contents()) allows you to configure how PHP handles it.

    There are more parameters than just method and content. You can set request headers, proxies, handle timeouts and everything. Please refer to the manual.

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

Sidebar

Related Questions

I really hope someone here can help out with this. I'm using Magento 1.6.1.0
I'm almost losing it, i really hope someone can help me out! I'm using
I really hope someone can help on this because I'm learning cocoa and have
This is really bugging me, so I hope someone can help me a bit
I really hope someone can help me with this. Basically i have an issue
I really hope someone can help with this problem. I have an ajax pagination
I really hope someone can help me with this. I'm struggling with it for
I'm driving myself nuts with this particular problem, i really hope someone can help!
Hi guys I hope someone can help me with this I´m really stuck although
I really hope someone who is a CC.NET expert can help with this, because

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.