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

  • SEARCH
  • Home
  • 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 1071829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:46:04+00:00 2026-05-16T20:46:04+00:00

Hi am doing some testing on the Freebase sandbox, but I can’t get the

  • 0

Hi am doing some testing on the Freebase sandbox, but I can’t get the following request to work. It hangs for ages then returns nothing. I have also outputted curl_getinfo() if it helps anyone work out where I am going wrong.

echo $uri = "http://".$this->config['apiSandboxHost'].'/'.$this->config['apiWritePath'].'={"create":"unless_exists","type":"/user/docs/music/note","name":"A","id":null}';

$ch = curl_init($uri);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$headers = array();
$headers[] = 'X-Metaweb-Request : idio';
$headers[] = 'Content-length: 78';
$headers[] = 'Content-type: application/x-www-form-urlencoded';
$headers[] = 'Cookie: '.  implode(';', $this->authCookies);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$output = curl_exec($ch);
pr(curl_getinfo($ch));
curl_close($ch);
echo $output;

Output

http://sandbox.freebase.com/api/service/mqlwrite?query={"create":"unless_exists","type":"/user/docs/music/note","name":"A","id":null}

Array
(
    [url] => http://sandbox.freebase.com/api/service/mqlwrite?query={"create":"unless_exists","type":"/user/docs/music/note","name":"A","id":null}
    [content_type] => 
    [http_code] => 0
    [header_size] => 0
    [request_size] => 693
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 285.371
    [namelookup_time] => 0
    [connect_time] => 0.185
    [pretransfer_time] => 0.185
    [size_upload] => 0
    [size_download] => 0
    [speed_download] => 0
    [speed_upload] => 0
    [download_content_length] => 0
    [upload_content_length] => -1
    [starttransfer_time] => 285.371
    [redirect_time] => 0
)

Thanks in advance for any help!

  • 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-16T20:46:04+00:00Added an answer on May 16, 2026 at 8:46 pm

    It ended up being an issue with the way I was sending data to freebase. Once I added

    curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
    

    it all worked fine.

    It was weird as I could only get it working when I sent the data as a post variable and also added content to the query string of the request.

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

Sidebar

Related Questions

Doing some testing but cannot fabricate debug environment so maybe someone can answer this.
I have been doing some testing with the following code to try and work
I'm doing some testing with WCF and we currently have the following Server setup
I was doing some testing and i realized that the writer doesn't get automatically
I've been doing some performance testing, mainly so I can understand the difference between
I'm currently doing some testing work with TOR and ran in to a small
I have been doing some testing with ObjectiveResource (iOS->Rails bridge). Things seem to work,
I am doing some testing in my iPhone app and I get this error:
Just doing some testing/prototyping with ClickOnce. Does anyone know why I can publish with
I've been doing some work testing web applications with Cucumber and I currently have

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.