playMaker

Author Topic: WWWPOST + Header  (Read 2410 times)

GPVFX_SB

  • Playmaker Newbie
  • *
  • Posts: 5
WWWPOST + Header
« on: August 10, 2018, 03:09:57 AM »
Hi Playmakers,

I'm setting up my backend via an IBM Cloudant but am getting a 415 Unsupported media type HTTP response

Would it be possible to add a "Content-Type: application/json" header to WWWPOST?

REFS:
https://www.ibm.com/support/knowledgecenter/en/SSHJB3_6.2.0/com.ibm.curam.content.doc/MSDK/tshoot_415_unsupported_media_type_response.html

https://www.codeproject.com/Articles/1111863/IBM-Cloudant-HTTP-API-in-a-Nutshell

 

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 219
Re: WWWPOST + Header
« Reply #1 on: August 18, 2018, 04:04:11 PM »
Bump.

I've occasionally wanted to test something inside playmaker and not python and getting header info is necessary.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: WWWPOST + Header
« Reply #2 on: August 29, 2018, 08:55:37 AM »
Hi,
 unfortunatly, WWW class is really plain bad and broken in most Unity versions one way or another.

https://forum.unity.com/threads/wwwform-with-binary-field-as-byte-array-form-parameter-issue.343847/

 I don't recommend using the WWW class for anything complex and instead rely on a proper implementation from a thirdparty or custom.

 what version of Unity are you working on?

I would go and try the c# httpwebrequest for a start https://docs.microsoft.com/en-us/dotnet/api/system.net.httpwebrequest?redirectedfrom=MSDN&view=netframework-4.7.2

 Bye,

 Jean


GPVFX_SB

  • Playmaker Newbie
  • *
  • Posts: 5
Re: WWWPOST + Header
« Reply #3 on: September 12, 2018, 06:27:10 PM »
Hi Jean,

Thanks very much for the additional documentation (and all your continued efforts).  I'll do more research and some experimentation with IBM "App Connect" which has a "Web Request" option as well and utilize "Easy Save" for the structured data.   I'm currently developing on Unity 2018.2.1f1. 


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: WWWPOST + Header
« Reply #4 on: September 13, 2018, 02:48:19 AM »
Hi,

let me know how it goes, if you find a good solution, I'd be willing to see if I can port this into actions.

 Bye,

 Jean