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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:26:44+00:00 2026-06-11T21:26:44+00:00

I am building a RESTful web service in PHP that accepts JSON as its

  • 0

I am building a RESTful web service in PHP that accepts JSON as its payload
.
Now, my question is, how exactly do I describe to the user the format that the JSON request comes in? I am new to JSON and don’t think I have a grasp 100%.

Will the other users system basically create a data structure (such an array) with the key value pairs that I need, encode this in JSON and send it to my web service?

Do I literally give them a copy of what the array needs to look like?
Thanks!

  • 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-11T21:26:45+00:00Added an answer on June 11, 2026 at 9:26 pm

    Adhering to the guidelines of REST, the input you get from the users of the API should either be part of the URL (for a GET request; doesn’t update data, i.e. http://example.com/api/doc/1243), or should be a POST variable (sent in the body of the HTTP request, to the same URL).

    So for documentation, all you should need to do is indicate the endpoint URL (http://example.com/api/doc/1243), the fact they need to use POST, and what the variables are (i.e. title, body, author, etc.). Then users will form the proper HTTP request however they want, and on your server end, because you’re using PHP, you’ll pull their variables from the $_POST array (i.e. $_POST['title'], $_POST['body'], etc.)

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

Sidebar

Related Questions

I'm building a RESTful web service that has the usual flavor of CRUD operations
I'm building a RESTful web service using Jersey that relies on MongoDB for persistence.
I'm building a RESTful web service which has multiple URIs for one of its
I'm building a restful web-service based on Spring. I'm using Spring Security. It will
I am building a RESTful web service in java using JAX-RS and jersey and
I'm thinking about building an application with a RESTful web service. My thought is
I'm building RESTful web service, and I want to allow it to participate in
I'm building a RESTful web service, using Catalyst::Controller::REST . Usually for web testing I
I'm building a RESTful web api with asp.net mvc, which returns pure json data.
I'm building a web service with a RESTful interface (lets call it MY_API ).

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.