question

houchi.admin avatar image
houchi.admin asked

How to return a custom header to the Client with PlayFab C# SDK from Cloud Function?

Hi

I want to return a custom header including the Database version to the client from Cloud Function so that the Client can update the database automatically.

I verified my API with Postman which can properly return a custom header in the HTTP Response like X-DB-Version.

However, when I used PlayFab C# SDK v1.13X to call the cloud function, I found my custom header was disappeared in HTTP Response.

Also, PlayFab C# SDK v1.13X does not support returning the HTTP headers but only the JSON data.

Please clarify the following questions for me and give me some suggestions.

Question:

  • Is it possible to return a custom header to the client from Cloud Function?

  • If possible, I need to modify the SDK to return the custom header to the client, right?

I look forward to your prompt reply.

Eric

apissdks
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Neils Shi avatar image
Neils Shi answered

PlayFab Cloud Function does not support the custom header. When you use PlayFab Cloud Function, you need to call API ExecuteFunction to tell PlayFab which AF you want to execute, and then PlayFab executes the function for you with additional content. The AF response is first returned to PlayFab, which then returns it to the client. During this process, PlayFab does not process custom headers, and you need to return the required information in the response body.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.