playMaker

Author Topic: WWWPOST + Header  (Read 273 times)

GPVFX_SB

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
WWWPOST + Header
« on: August 10, 2018, 12: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: 130
    • View Profile
Re: WWWPOST + Header
« Reply #1 on: August 18, 2018, 01: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: 13432
  • Official Playmaker Support
    • View Profile
Re: WWWPOST + Header
« Reply #2 on: August 29, 2018, 05: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: 2
    • View Profile
Re: WWWPOST + Header
« Reply #3 on: September 12, 2018, 03: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: 13432
  • Official Playmaker Support
    • View Profile
Re: WWWPOST + Header
« Reply #4 on: September 12, 2018, 11:48:19 PM »
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