{"id":15490313,"url":"https://github.com/arunprakashg/wordpresscore","last_synced_at":"2026-02-23T23:35:24.436Z","repository":{"id":53575607,"uuid":"341892996","full_name":"ArunPrakashG/WordpressCore","owner":"ArunPrakashG","description":"C# library to interact with Wordpress REST API in a fluent pattern.","archived":false,"fork":false,"pushed_at":"2023-12-13T18:31:05.000Z","size":107,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T19:08:55.187Z","etag":null,"topics":["csharp","dotnet","dotnet-standard","wordpress"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArunPrakashG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-24T12:27:10.000Z","updated_at":"2024-01-10T23:02:38.000Z","dependencies_parsed_at":"2024-10-02T07:31:13.333Z","dependency_job_id":null,"html_url":"https://github.com/ArunPrakashG/WordpressCore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArunPrakashG%2FWordpressCore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArunPrakashG%2FWordpressCore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArunPrakashG%2FWordpressCore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArunPrakashG%2FWordpressCore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArunPrakashG","download_url":"https://codeload.github.com/ArunPrakashG/WordpressCore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250306639,"owners_count":21408926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","dotnet-standard","wordpress"],"created_at":"2024-10-02T07:20:29.561Z","updated_at":"2026-02-23T23:35:24.399Z","avatar_url":"https://github.com/ArunPrakashG.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordpressSharp\nLibrary to interact with Wordpress REST API in a fluent pattern.\n\n## NO LONGER MAINTAINED\n\nAvailable on [Nuget](https://www.nuget.org/packages/WordpressCore/)\n\n## Supported Platforms\n* .net standard 2.1\n* .net 5\n* .net core 3.0\n* .net core 3.1\n\n## Note\nThis library was developed for one of my client projects to fix many limitations of existing libraries.\nLibrary is not yet complete by any means. I have only implemented basic requests and structure. i hope to complete this soon as my time allows me.\n\n## Example\n***You can checkout full sample [Here](WordpressSharp.Demo/Program.cs)***\n\n```cs\nCookieContainer container = new CookieContainer();\n\t\t\tCancellationTokenSource cancellationTokenSource = new CancellationTokenSource();\n\t\t\tWordpressClient client = new WordpressClient(\"http://demo.wp-api.org/wp-json/\", maxConcurrentRequestsPerInstance: 8, timeout: 60)\n\n\t\t\t// add default user agent\n\t\t\t.WithDefaultUserAgent(\"SampleUserAgent\")\n\n\t\t\t// use pre configured cookie container\n\t\t\t.WithCookieContainer(ref container)\n\n\t\t\t// pass custom json serializer settings if required\n\t\t\t.WithJsonSerializerSetting(new JsonSerializerSettings() {\n\t\t\t\tConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,\n\t\t\t\tMissingMemberHandling = MissingMemberHandling.Ignore\n\t\t\t})\n\n\t\t\t// pre process responses received from the api (can be used for custom validation logic etc)\n\t\t\t.WithGlobalResponseProcessor((responseReceived) =\u003e {\n\t\t\t\tif (string.IsNullOrEmpty(responseReceived)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// keep in mind that, returning true here completes the request by deserilizing internally, and then returning the response object.\n\t\t\t\t// returning false will terminate the request and returns a Response object with error status to the caller.\n\t\t\t\treturn true;\n\t\t\t})\n\n\t\t\t// add default request headers\n\t\t\t.WithDefaultRequestHeaders(new KeyValuePair\u003cstring, string\u003e(\"X-Client\", \"Mobile\"), // allows to add custom headers for requests send from this instance\n\t\t\t\t\t\t\t\t\t   new KeyValuePair\u003cstring, string\u003e(\"X-Version\", \"1.0\"));\n\n\t\t\t// create a Posts request\n\t\t\tResponse\u003cIEnumerable\u003cPost\u003e\u003e posts = await client.GetPostsAsync((request) =\u003e request.OrderResultBy(Order.Ascending)\n\t\t\t\t// only get posts with published status\n\t\t\t\t.SetAllowedStatus(Status.Published)\n\n\t\t\t\t// specifys the response should contain embed field\n\t\t\t\t.SetEmbeded(true)\n\n\t\t\t\t// set scope of the request, default is view, set scope as edit for edit requests\n\t\t\t\t.SetScope(Scope.View)\n\n\t\t\t\t// set allowed categories of post. only posts in these categories will be in response. should be category id.\n\t\t\t\t.AllowCategories(51, 32)\n\n\t\t\t\t// set allowed authors of post. only posts by these authors will be in response. should be author id.\n\t\t\t\t.AllowAuthors(47, 32, 13, 53)\n\n\t\t\t\t// adds a cancellation token to the request, allowing to cancel the request anytime as needed\n\t\t\t\t.WithCancellationToken(cancellationTokenSource.Token)\n\n\t\t\t\t// sets the maximum number of posts in a single page\n\t\t\t\t.WithPerPage(20)\n\n\t\t\t\t// gets the first page of posts containg 20 posts, specifying 2 here will get next page. used for pagenation\t\n\t\t\t\t.WithPageNumber(1)\n\n\t\t\t\t// adds request specific authorization. can be BasicAuth or Jwt Authentication methods. Use plugin for Jwt\n\t\t\t\t.WithAuthorization(new WordpressAuthorization(\"username\", \"password\", type: WordpressClient.AuthorizationType.Jwt))\n\n\t\t\t\t// specifiys a response validator/processor for current request\n\t\t\t\t.WithResponseValidationOverride((response) =\u003e {\n\t\t\t\t\tif (string.IsNullOrEmpty(response)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// returning true completes the request by returning deserialized response\n\t\t\t\t\t// returning false terminates the request with an error message\n\t\t\t\t\treturn true;\n\t\t\t\t})\n\n\t\t\t\t// Should be called at the end of the builder to build the request as a Request object\n\t\t\t\t// pass a Callback container to get events on internal activity for this request\n\t\t\t\t.CreateWithCallback(new Callback(OnException, OnResponseReceived, OnRequestStatus))).ConfigureAwait(false);\n\n\t\t\tif (!posts.Status) {\n\t\t\t\t// Request failed\n\t\t\t\tConsole.WriteLine(posts.Message);\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tforeach (Post post in posts.Value) {\n\t\t\t\t// do yer magic!\n\t\t\t}\n```\n\n## Goals\n* Implement rest of the endpoints of REST API\n* Reduce memory consumption further internally\n* Replace `IAsyncEnumerable` with an alternative to support more platforms\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farunprakashg%2Fwordpresscore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farunprakashg%2Fwordpresscore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farunprakashg%2Fwordpresscore/lists"}