Friday, July 26, 2019

Rest API Response Types and Required Keys and Optional Keys


When setting up a JSON API, you'll have all kinds of different types of calls and responses. Send separates responses into some basic types, and defines required and optional keys for each type:
Type
Description
Required Keys
Optional Keys
success
All went well, and (usually) some data was returned.
status, data
fail
There was a problem with the data submitted, or some pre-condition of the API call wasn't satisfied
status, data
error
An error occurred in processing the request, i.e. an exception was thrown
status, message
code, data

No comments:

Post a Comment

Recent Post

Databricks Delta table merge Example

here's some sample code that demonstrates a merge operation on a Delta table using PySpark:   from pyspark.sql import SparkSession # cre...