API Testing
API Testing
Ahmed Elkholy
01551942560
API : Application Programming Interface , it’s intermediate between UI
app and back end , like this website Dummy Rest API Example , and
json place holder ,Google search also consider as an API request .
There are two ways to send or receive API data using XML file or JSON
file , using two protocols for this SOUP and REST .
1. Start line
2. Header
3. Blank line
4. Body
<shawrma>
<size> small </size>
<type> chicken </type>
<additions>
<add>tomia</add>
<add>cheese</add>
<add>salad</add>
</additions>
</shawrma>
{
"shawerma"
:[
{
"size" :"large" ,
"type" : "chicken",
"additions" :["tomia" ,
"tehena" ,"cheese"] },
{
"size" :"small" ,
"type" : "meat",
"additions" :["tomia" , "tehena" ]
}
]
}
So we will use postman to test API , and you can use postman online if
you pressed on
PATCH is used for partial updates, where only specific changes are
applied to a resource, while PUT is used for full updates or creation of a
resource, requiring the complete representation of the resource in the
request payload
Post man
The first request in post man ( GET ), so you have first to create a
collection like a folder ,
then the file (Get , Post , …..) ,
the API link httpbin.org/get ,
Finally the response of API will appear at the end of page
Will create another request type which is post using this link
httpbin.org/post , will send JSON data in the body , finally
response of this request will be the same sent data
There is another website that you can use it for API testing known as
webhook.site and any request you make on postman will appear at
this website , so first you have to copy Your unique URL from this website
into postman .
You can send parameters with it’s value to this website and you can
send any header with it’s value like X-Do-Not-Track and it’s value is 1 .