Questions tagged [grapevine]

Grapevine is a .NET class library for embedding REST/HTTP servers and/or clients inside any application. Grapevine allows you to map HTTP Methods and URL patterns (using regular expressions) to specific methods and streamlines connecting and communicating with REST servers using simple patterns and placeholders.

Grapevine is a .NET class library for embedding REST/HTTP servers and/or clients inside any application. Grapevine allows you to map HTTP Methods and URL patterns (using regular expressions) to specific methods and streamlines connecting and communicating with REST servers using simple patterns and placeholders.

  • 4.1.1 - Latest stable version on NuGet

Primary Use Case

Grapevine is designed for use in an application for which being a REST or HTTP client or server is not the primary function or purpose of the application, but rather a standardized means of communication with the application.

For example, a Widows Forms application or Windows Service would be the "primary" means of communication with an application, and having a Grapevine RESTServer (or several) listening on a particular protocol/host/port combination would be a secondary means of communication - even if Grapevine is used to expose the majority of the functionality.

Having a REST client in the same package means you can both produce and consume REST services - such as building an application that actively communicates with other applications like it on the network by initiating the conversation, not just waiting around to for something else to initiate a conversation with it.

Features

  • Embed a REST server in your application. Add attributes to your classes and methods to define resources and routes for managing traffic based on HTTP method and path info (using regular expressions). The message context is passed to your route every time, and each resource has a reference to the server that spawned it.

  • Manage multiple REST servers simultaneously and easily with a RESTCluster. Scope your resources to one, many or all REST servers.

  • Serve up static files (HTML, CSS, JavaScript, images, etc.) with virtually no configuration. Each server can have a unique location to serve files from, or they can all share a location.

  • Embed REST clients to interact with remote RESTful APIs. Initiate exchanges as well as respond them.

  • Write messages out to a common event log for your entire application using EventLogger. 404 Not Found and 500 Internal Server Error responses are handled automatically if a route or file cannot be found or throws an unhandled exception, respectively. Have complete control over the response returned to the client.

Frequently Asked Questions

35 questions
2
votes
1 answer

Grapevine.RESTClient throws exception about cookies if service is not up

So I'm using Grapevine.RESTClient to manage the client side of my REST interface. I'm using it to communicate between a service running in LocalSystem and a process run by the user on the same machine. My problem is that when the service is not…
Holm76
  • 216
  • 2
  • 11
2
votes
1 answer

(partial) HTTP Request isn't recognized by C# HTTP Server

In my visual studio 13 console application, I receive following byte stream on a TCP-Socket(receiving from a embedded device): POST /setup HTTP/1.1 Content-Length: 6 Content-Type: application/setup+tlv8 TLV8-data Although it seem to be a valid…
1
vote
1 answer

Import Grapevine (5.0.0-rc.7) into Unity project/NuGet Package not shown in NuGetForUnity

I am trying to import Grapevine (Version 5.0.0, release candidate 7) into my Unity Project (Unity Version 2021.1). Therefore, I use NuGetForUnity. If I type in "Grapevine", the search results show me "Grapevine" (Version 4.2.2) and "Grapevine.Core"…
JPF
  • 25
  • 4
1
vote
1 answer

Unhandled exception at Grapevine.Interfaces.Server.HttpResponse.SendResponse

I have a server which listens to HTTP POSTs that several client make sending information. I use Grapevine as http server because methods are really simple and didn't need the complexity of ASP. Sometimes I get this random error: 2017-12-12…
Vallo
  • 1,827
  • 2
  • 21
  • 42
1
vote
1 answer

Grapevine RestClient Json Body

I'm having difficulty putting together a request by sending a json content, can not find anything in the 4.x documentation it's completely different from version 3.x RestClient client = new RestClient(); client.Host = "localhost"; client.Port =…
Elvis Reis
  • 155
  • 4
  • 12
1
vote
1 answer

Grapevine restserver not reacheable with useHTTPS

When I set the useHttps property to true, I am not able to reach the server. The instantiation of the server looks like this: class Listener { RestServer server; public Listener() { server = new RestServer(); …
RasmusG
  • 39
  • 8
1
vote
0 answers

Running Grapevine REST server in Mono Docker container

I´ve built a simple REST server with Grapevine which runs perfectly with windows environment. Now I want to run the .exe (with the Grapevine.dll) in an Docker Container with mono. My Dockerfile looks like this: FROM mono:latest COPY . /boerse RUN…
Strizzi
  • 59
  • 9
1
vote
1 answer

Cannot load type HttpListener in simple Grapevine server example

I am trying to use Grapevine to implement a simple C# REST server. I am using Xamarin Studio on OSX. I pulled Grapevine 4.0.0.195 as a package. However, when I try to run the example given on https://sukona.github.io/Grapevine/, I get this error:…
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
1
vote
1 answer

File upload example for grapevine

I am new to Web API and REST services and looking to build a simple REST server which accepts file uploads. I found out grapevine which is simple and easy to understand. I couldn't find any file upload example? This is an example using…
Ajax
  • 13
  • 3
1
vote
0 answers

How to respond with a stream using Grapevine server

Is it possible, using Grapevine, to create an endpoint that returns a stream, such as a video? In WCF I would create a function with a return type of Stream. All Grapevine functions return IHttpContext. Can I use something like…
argyle
  • 1,319
  • 2
  • 14
  • 28
1
vote
1 answer

Grapevine 3.1 - 'The process cannot access the file'

I have a solution that utilises Grapevine to start a server within the Program class. For some reason though, as soon as I start the program, it crashes when server.Start() is called. No other parts of the solution are running at this point, so I…
3therk1ll
  • 2,056
  • 4
  • 35
  • 64
1
vote
1 answer

Cannot connect to Grapevine from another computer on the same network

I am using Grapevine 3.1.0 in VS2013. The project is called ConsoleApplication1. After starting the server on my host machine, I can access it locally from localhost:1234, 127.0.0.1:1234, and 192.168.1.2:1234 (my machine's local IP address).…
copernicus
  • 11
  • 3
1
vote
2 answers

Accessing Grapevine REST Server over network

I want to implement REST interface for my application. After some search, I select Grapevine (Got from stackoverflow itself.). It works fine. the problem is, the server accessible using localhost only. Even the server listening on 0.0.0.0:8080, the…
anishpsla
  • 73
  • 1
  • 2
  • 10
1
vote
1 answer

Grapevine sample REST server code returns a "Not found" response

I'd like to implement a simple REST server using Grapevine Plus and am following the examples provided on the wiki. I installed Grapevine Plus 3.0.4 via NuGet. I'm running the following code, but when I navigate to http://localhost:1234 via browser,…
w128
  • 4,680
  • 7
  • 42
  • 65
1
vote
1 answer

How do I write a regular expression to route traffic with Grapevine when my request URL has a query string?

I'm using Grapevine and I want to route request traffic that has a query string, and I don't know regular expressions well enough to figure out why it's not working. e.g. http://localhost:1234/service/function?param1=1¶m2=2 And I defined my…
Scott Offen
  • 6,933
  • 3
  • 21
  • 24
1
2 3