Skip to content

This is a ScriptCs script pack which allows you to write clean, declarative and non-boilerplate http requests from your scriptcs files.

License

Notifications You must be signed in to change notification settings

johncrn/ScriptCs.Request

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScriptCs.Request

A ScriptCs script pack which allows you to write clean, declarative and non-boilerplate http requests from your scriptcs (.csx) files.

Using this script pack you can write very simple scripts similar to this:

public class Notification
{
	public string Message {get; set;}
	public string SenderName {get; set;}
}
var notificationToSend = new Notification { Message = "Merry christmas!", SenderName = "Santa"};
var client = Require<Request>();
var result = client.PostJson("http://your.site.com/api/notification", notificationToSend);
Console.WriteLine("Response status code: " + result.StatusCode);

The script pack also has the Json.NET namespace available so you can make use of different Json.NET serialization possibilities (e.g. [JsonIgnore]) to suit your needs.

About

This is a ScriptCs script pack which allows you to write clean, declarative and non-boilerplate http requests from your scriptcs files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%