Skip to content

request http small c# library that can help to call rest api with small amount of code

License

Notifications You must be signed in to change notification settings

Arunk28/request_http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HttpLibrary

NuGet package

Http library used to make rest calls easily in c# projects

How to use

Install this library and follow the below steps

Add Name space before using in your class file

using System;
using request;

GET


                    HttpProperties httpProperty = new HttpProperties()
                    {
                        dictObject = null,
                        methodType = "GET",
                        sync = true,
                        token = this.token.access_token, --optional
                        url =<request url>
                    };

                    object s = Http.HttpRequest(httpProperty);

POST

                    Dictionary<string, string> dict = new Dictionary<string, string>();
                    dict.Add("xxKey",xxxxvalue);
                    dict.Add("xxKey",xxxxvalue);
                            
                    HttpProperties httpProperty = new HttpProperties()
                    {
                        dictObject = dict,
                        methodType = "POST",
                        sync = true,
                        token = this.token.access_token, --optional
                        url =<request url>
                    };

                    object s = Http.HttpRequest(httpProperty);

PUT

                    Dictionary<string, string> dict = new Dictionary<string, string>();
                    dict.Add("xxKey",xxxxvalue);
                    dict.Add("xxKey",xxxxvalue);
                            
                    HttpProperties httpProperty = new HttpProperties()
                    {
                        dictObject = dict,
                        methodType = "PUT",
                        sync = true,
                        token = this.token.access_token, --optional
                        url =<request url>
                    };

                    object s = Http.HttpRequest(httpProperty);

DELETE

                    Dictionary<string, string> dict = new Dictionary<string, string>();
                    dict.Add("xxKey",xxxxvalue);
                    dict.Add("xxKey",xxxxvalue);
                            
                    HttpProperties httpProperty = new HttpProperties()
                    {
                        dictObject = dict,
                        methodType = "DELETE",
                        sync = true,
                        token = this.token.access_token, --optional
                        url =<request url>
                    };

                    object s = Http.HttpRequest(httpProperty);

About

request http small c# library that can help to call rest api with small amount of code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages