Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by tldQuantic · Dec 10, 2019 at 07:11 PM · apissdksdataContent

How to Upload and Download a file with the C++ SDK?

Hi,

I am reading the following documentation: https://docs.microsoft.com/fr-fr/gaming/playfab/features/data/playerdata/entity-files

But I cannot find in the C++ SDK the equivalent of these two C# functions used in your sample:

PlayFabHttp.SimplePutCall and PlayFabHttp.SimpleGetCall

It seems I cannot make a WinHttpOpenRequest function call with GET and PUT HttpMethod.

In your function:

void PlayFabWinHttpPlugin::ExecuteRequest(std::unique_ptr<CallRequestContainer> requestContainer)

...

hRequest = WinHttpOpenRequest(hConnect, L"POST", urlComponents.lpszUrlPath, NULL, WINHTTP_NO_REFERER, NULL, winHttpOpenRequestFlags);

So I created a Cloudscript function to make a http request and it works fine but I want to know how to do this directly by usign your C++ SDK.


Thanks in advance for your help.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Citrus Yan · Dec 11, 2019 at 09:21 AM

The PlayFabHttp.SimplePutCall and PlayFabHttp.SimpleGetCall method are from the UnitySDK, which you can find the definition in here:

PlayFabHttp.SimplePutCall

PlayFabHttp.SimpleGetCall

However, referring to the C++ SDK, looks like it does not natively support making Get/Put http requests, hence, to make Get/Put requests in your C++ project, you might want to consider implementing this feature yourself, and, you may find this C# implementation helpful: SimplePutCall.

Comment
tldQuantic

People who like this

1 Show 2 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tldQuantic · Dec 12, 2019 at 01:38 AM 0
Share

Ok, thanks for your answer.

For many reasons, I don't want to make any changes in the source code of the C++ SDK.
So I just checked the code and I think the best way to do it is to implement my own version of the HttpPlugin for all platforms and provide them to the PlayFabPluginManager via the SetPlugin function.

What do you think of this workaround?

But in my opinion, it would be much easier for all the users of your C++ SDK to provide an HttpPlugin with GET and PUT http methods as you did it in your Unity SDK.

avatar image Citrus Yan tldQuantic · Dec 12, 2019 at 06:07 AM 1
Share

Sounds great to me! And, about providing a HttpPlugin with GET and PUT http methods in the C++ SDK, please make a feature request to help us improve the service here:

https://community.playfab.com/spaces/24/index.html

The more information we have on the needs of our developer community, the better we are able to prioritize our work, again, thanks for your feedback!

avatar image

Answer by tldQuantic · Dec 12, 2019 at 05:04 PM

Ok, thanks for your help.


I will make a feature request about this topic.

Comment
Citrus Yan

People who like this

1 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Add running count every time any player presses the same button. Like a limited store item or something where only 10 users could purchase one before it's sold out. 1 Answer

    Java API - Stupid question 1 Answer

    Custom data from the catalog item is not returned correctly. 1 Answer

    Display Properties for User Generated Content? 1 Answer

    CDN files upload with nodejs script and https 2 Answers

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges