Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add possibility to add parameters to RPC request #29

Open
Ruhrpottpatriot opened this issue Apr 21, 2020 · 0 comments
Open

Feature: Add possibility to add parameters to RPC request #29

Ruhrpottpatriot opened this issue Apr 21, 2020 · 0 comments

Comments

@Ruhrpottpatriot
Copy link

From within UE4 I call an rpc function like this:

		auto successFunc = [](const Nakama::NRpc& rpc)
		{
			UE_LOG_ONLINE_SESSION(Log, TEXT("Session Create Success"));
		};
		Nakama::ErrorCallback errorFunc = [](const Nakama::NError& error) 
		{
			UE_LOG_ONLINE_SESSION(Error, TEXT("Session Create Error: %s"), UTF8_TO_TCHAR(error.message.c_str()));
		};

		std::string foo = R"({"owning_user_id": "Test","owning_username":"TestName","session_name": "GameSession","session_state": 0})";
		client->rpc(sessionPtr, "sessions/create", foo, successFunc, errorFunc);

In some cases there might be the need to add url parameters or headers to an RPC request. However this is currently not possible.

For example a user might have an RPC that updates data of a player-party. Showing the intent by using PUT could make api intent clearer. Another example would be a server whose response to a procedure can be a different MIME type and the client passes the type via header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant