Forum C# Questions on Web.Post method

Questions on Web.Post method

Postby DogCat » July 12th, 2013, 6:47 am

I am planning to use the server side Web.Post method to send a game progress data to another 3rd party middleware server. According to your document, it seems that Player.IO Web.Post can send a data represented in Dictionary<string, string> form.

So, may I ask if there are methods to represent the data in 'JSON' format and then send it to the 3rd party server using Web.Post method? Posting a data represented in a Json format is pretty popular at this moment so if you can provide some solutions for that, it would be appreciated.

If it is not yet supported, it would be also appreciated if you can let me know if it is in your future development road map or if there are other solutions that can be used for that when making the player.io dll file.

Thanks in advance, and I will be looking forward to hearing back. Have a nice day.
DogCat
 
Posts: 8
Joined: May 10th, 2013, 11:03 pm

Re: Questions on Web.Post method

Postby Henrik » July 12th, 2013, 10:42 am

Just put your json as the only value in that dictionary, then you can pick it up server-side. The transport format for your data shouldn't really matter.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Questions on Web.Post method

Postby DogCat » July 12th, 2013, 4:50 pm

So do you mean we can put the json data represented in a regular string format to a value field of the Dictionary and then send it to the server? And then make the server get the data and pick the json data from the dictionary appropriately?

The problem is that we need to send data to a 3rd party server we cannot modify its behavior or change the code. They are just asking to send a data represented in json using the POST method. They are not providing a programming environment.

So, it would ne appreciated if you can let me know how to work out this issue. Thank you very much and have a nice weekend.
DogCat
 
Posts: 8
Joined: May 10th, 2013, 11:03 pm

Re: Questions on Web.Post method

Postby DogCat » July 12th, 2013, 6:32 pm

Or do you mean if we put the json as the only value in the dictionary, it will be encoded as an appropriate byte form during the POST method transmission time that can be recognized correctly by the 3rd party server waiting for a json data?

If so, which string I should use as the key for that? Again, we are planning to use a 3rd party server collecting data and request in json form through the POST and then display operation results on its web dash board. We cannot change or program the data receiving or decoding module of the server.
DogCat
 
Posts: 8
Joined: May 10th, 2013, 11:03 pm

Re: Questions on Web.Post method

Postby Henrik » July 16th, 2013, 3:50 am

DogCat wrote:The problem is that we need to send data to a 3rd party server we cannot modify its behavior or change the code. They are just asking to send a data represented in json using the POST method. They are not providing a programming environment.

Sorry, we only support key/values, not custom POST bodies right now.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Questions on Web.Post method

Postby DogCat » July 16th, 2013, 3:54 am

Thank you very much for your response. Then, do you have any development plan for this on your roadmap, or would you please recommend some other libraries we can use for this? If we can use .Net standard HTTP call, I think the problem can be solved.
DogCat
 
Posts: 8
Joined: May 10th, 2013, 11:03 pm

Re: Questions on Web.Post method

Postby DogCat » July 16th, 2013, 4:00 am

Just one more question. Maybe we need to use the POST method of Player.IO in near future with an external server that we can program. In that case, would you please let us know how to decode that transmitted data? I mean, the external server may not be a .Net environment, so it may not be able to read the data in C# dictionary data directly.
DogCat
 
Posts: 8
Joined: May 10th, 2013, 11:03 pm

Re: Questions on Web.Post method

Postby Henrik » July 16th, 2013, 10:29 pm

Yes, if you have a simple webserver somewhere, you can "bounce" the post request through that, so that you can format it in the exact way necessary for the system you're trying to integrate with.

When you use http://playerio.com/documentation/refer ... y.web#Post, it transmits the data as key value strings, so there's no special encoding or anything, just standard POST.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Questions on Web.Post method

Postby Henrik » July 16th, 2013, 10:46 pm

DogCat wrote:Thank you very much for your response. Then, do you have any development plan for this on your roadmap, or would you please recommend some other libraries we can use for this? If we can use .Net standard HTTP call, I think the problem can be solved.

We're sorry, but this is not currently on our roadmap. You're not the first one to request the feature though, so it's definitely on the wishlist, but we can't say when it would get released.

If you're on the main Player.IO cluster, serverside code is restricted, so the entire .Net API is not available for security reasons, so the only way to contact outside servers is through the Web.Post methods.

If you rent dedicated servers we can remove the restrictions, and then you can use the full API, such as WebRequest to craft your own requests in any way you want.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Questions on Web.Post method

Postby DogCat » July 17th, 2013, 12:54 am

So, let's summarize the solution. Please let me know if I am understanding correctly.

1. So, we can setup a simple web server that can bounce the data from Player.IO Web.POST to the external server we are planning to integrate. The Web.POST will transmits the data as a regular key value strings without any special encoding or anything. So it can be easily decoded.

So it would be a form where we can easily find out the number of key value pairs or length of each key and value? If it is a regular string without any special encoding, and if it is recognizable by human programmer, then I think we can implement appropriate decoder.


2. And you can remove the server side code restriction if we rent dedicated servers so that we can use the full .Net network API including WebRequest. That also sounds great. If possible, may I ask the renting price for the dedicated server system? We actually are planning to rent one when we release our game so it would be a good time to ask.


Anyway, thank you very much for all your kind answers. They are very helpful for us. Have a nice day.
DogCat
 
Posts: 8
Joined: May 10th, 2013, 11:03 pm

Re: Questions on Web.Post method

Postby DogCat » July 17th, 2013, 7:19 pm

After some internal discussion about this. we concluded that we should go with a paid plan and dedicated server.

I would like to ask something more about this. Is it your official policy to remove that restriction and make developers to use other .Net functions? We just want to make it sure before paying for something.

After removing the restriction, may I ask how to develop a dll integrated with .Net functions? Actually, I tried to compile a dll with other .Net features but I got some compile error. Is it possible to integrate and use all those .Net functions in the MS Visual Studio project template I downloaded? Or are you going to provide some other project template with different libraries?

And we would like to ask pricing option for using dedicated server.

Thank you very much for all the information you provided and we are waiting for hearing back from you. Have a nice day.
DogCat
 
Posts: 8
Joined: May 10th, 2013, 11:03 pm

Re: Questions on Web.Post method

Postby HVStudios » August 17th, 2013, 12:31 am

I am Tae Joon Park working at Hidden Variable Studio. I was using the ID 'DogCat' before, but currently using 'HVStudios'.

Regarding this issue, we contacted with Chris Benjaminsen on the last July 17, and he said he would try to find another solution. But after that, we haven't heard any update of this issue even though we tried to contact with him couple of times.

So, if possible, it would be appreciated if you can provide the current status. Since Chris promised that he might be able to find some clever solution, we are expecting to hear some good news.

The only thing we need to know is the current status. It would be good if it is almost resolved, but it is also OK if there is not any progress. Actually, we are planning to release the app soon, so we need to know what is going on and try to find other solution if you cannot resolve it (Since Chris said he might be able to resolve it, it would be much better if you can resolve it, but we are now hoping to hear about the current status so that we can make a decision on how to resolve the issue).

We will be looking forward to hearing back from you, and we are not expecting the case that we should make a decision without hearing from you. It is fine to hear 'no' if it is not yet resolved, so please let us know.


For your information, here is the conversation with Chris about this matter.


Hey Tae,

While it's technically possible to remove any and all serverside restrictions on our MP server cluster, it's normally not something we offer to any but enterprise level clients we have direct contractual agreements with.

I assume your issues revolve around the in-ability to define headers when using the MP server? Actually can you give me a rundown of the issue and I might be able to find some clever solution, either in yours our our code :)

- Chris


On Wed, Jul 17, 2013 at 5:59 PM, Tae Joon Park wrote:
Hi Chris,

This is Tae Joon Park at Hidden Variable Studios. We are using the Player.IO to implement backend system for our games. While investigating features of the Player.IO, I asked some questions regarding Web.POST method to your forum (C# section), and found that our current issues can be resolved by using dedicated server system with paid account.

I also asked about the pricing option to the forum thread, but it would not be a topic can be discussed in an open public place. So, I would like to ask about pricing options for dedicated server environment

Just for your information, I received a response in the forum thread that you can remove restrictions in a dedicated server environment so that we can use all the .Net standard functionalities. In that way, our current issue can be resolved easily.

Thank you very much in advance and we are looking forward to hearing back from you. Have a nice day.



Best Regards,



Tae Joon Park
Senior Programmer | Hidden Variable Studios
HVStudios
Paid Member
 
Posts: 20
Joined: July 30th, 2013, 7:15 pm


Return to C#