Sunday, 25 June 2023

Solved Information Technology Tools and Network Set1 | NIELIT O Level

 (M1-R5) Solved  Information Technology Tools and Network Set1 | NIELIT O Level

1.1 : Which of the following function is used to display current date and time?
(A) Date( ) (B) Today( ) (C) Now( ) (D) Time( )

1.2 : In presentations, which of the following can be inserted?
(A) Sound Clips (B) Movie Clips
(C) Both (A) & (B) (D) None of the above

Sunday, 18 June 2023

Solved Internet of Things and its applications (M4-R5) January 2022

Q 1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the "OMR" answer sheet supplied with the question paper, following instructions therein.

1.1 : Which protocol is lightweight ?
(A) MQTT
(B) HTTP
(C) CoAP
(D) SPI

Saturday, 17 June 2023

Get Rest API | Core PHP

This post will help you to make get API to return records using core PHP  in JSON format.

Return A single record

<?php

header("Content-Type:application/json");

$response['roll'] = 101;
$response['name'] = "ram";
$response['city'] = "vns";
$json_response = json_encode($response);
echo $json_response;

?>

Next Example

Read (Consume) Rest API using VB.NET Windows Programming

 This post will help you to read a single record from API in JSON format using VB.Net Windows form Application.

Data formate 

{"roll":101,"name":"ram","city":"vns"}
Package Install
NuGet\Install-Package Newtonsoft.Json -Version 13.0.3
Code
Imports System.Net
Imports Newtonsoft.Json.Linq
  Dim json As String = New System.Net.WebClient().DownloadString("your api url")
  Dim parsejson As JObject = JObject.Parse(json)
  Label1.Text = "Roll=" & parsejson.SelectToken("roll").ToString  & ", Name=" &        parsejson.SelectToken("name").ToString  & ", City=" &   parsejson.SelectToken("city").ToString        

   Next Example