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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:08:50+00:00 2026-05-25T16:08:50+00:00

I am testing wireit and am able to create new form containers and such.

  • 0

I am testing wireit and am able to create new form containers and such. I tested the ajax adapter example and have it configed something like:

WireIt.WiringEditor.adapters.Ajax.config =  {
    saveWiring: {
        method: 'PUT',
        url: 'http://voipd7.localhost/wirings.json'
    },
    deleteWiring: {
        method: 'GET',
        url: function(value) {
            if(console && console.log) {
                console.log(value);
            }
            // for a REST query you might want to send a DELETE /resource/wirings/moduleName
            return "fakeSaveDelete.json";
        }
    },
    listWirings: {
        method: 'GET',
        url: 'listWirings.json'
    }

The save url “http://voipd7.localhost/wirings.json” is a php page that just writes the $_GET or $_Post to file, but the only thing that it outputs is:

Array
(
    [q] => wirings.json
)

Am I missing something? Shouldnt this be sending json stuff via get or post?

  • 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-25T16:08:51+00:00Added an answer on May 25, 2026 at 4:08 pm

    From the provided configuration, it is evident that the HTTP method for doing a save operation is PUT. When using this method, the superglobal variables $_POST or $_REQUEST do not contain the posted data. $_GET will still have the data from the query string.

    To parse the posted data when the method is PUT, do some of the following:

    $vars = array();
    parse_str(file_get_contents("php://input"), $vars);
    

    The PUT method expects to receive file as input. That is why we use file_get_contents and parse_str parses the argument as if it were the query string passed via a URL. To extract the data variables regardless of the method use:

    $vars = array();
    if($_SERVER['REQUEST_METHOD'] == 'GET') {
        $vars = $_GET;
    } else if($_SERVER['REQUEST_METHOD'] == 'POST') {
        $vars = $_POST;
    } else if($_SERVER['REQUEST_METHOD'] == 'PUT') {
        parse_str(file_get_contents("php://input"), $vars);
    }
    

    I based the reply on this very nice article: http://www.lornajane.net/posts/2008/accessing-incoming-put-data-from-php

    One note: usually the web server is configured not to allow PUT methods but when it sees (at least Apache does this) that the PUT request is for an existing file, it calls this file to handle the request and the above code can be used in the file to extract the sent parameters.

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

Sidebar

Related Questions

For testing purposes I need to create sets of text files that have similar
For testing purposes I have to generate a file of a certain size (to
Fot testing iPhone apps, is it a bad idea to have a development code
im testing symfony form validation. the problem is very simple. no matter what i
When testing my iPhone app I have found it incredibly useful to log information
For testing purpose, I need to create logs in a CSV file in my
When testing an answer for another user's question I found something I don't understand.
Testing part of a form. So, right now I just want to alert what
Testing: return request.getCookies() == null; is not an appropriate way test. Is there another
Testing out someone elses code, I noticed a few JSP pages printing funky non-ASCII

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.