Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by ina · Aug 30, 2011 at 01:14 AM · wwwxmlwwwformheadersaddfield

Posting raw XML data to web - no parameter name

The WWWForm requires a AddField(parameter name, value). Right now, I am trying to interface a web API that just expects XML to be posted to it. Is there a way to just post xml data from Unity without explicitly binding it to an AddField parameter?

Comment
Add comment
10 |3000 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
0

Answer by Waz · Aug 30, 2011 at 04:13 AM

Use the WWW constructor that takes plain bytes of postData, rather than taking a WWWForm.

Comment
Add comment · Show 1 · Share
10 |3000 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 ina · Aug 30, 2011 at 05:47 AM 0
Share

how do you convert a string or char array to a byte array... i tried string.ToCharArray() - but unity 3.4 has issues taking char arrays as byte arrays "The type 'UnityEngine.WWW' does not have a visible constructor that matches the argument list '(String, char[])'."

avatar image
0

Answer by Bunny83 · Aug 30, 2011 at 04:16 AM

Yes you can, just don't use WWWForm because it's designed to represent a web-formular and therefore only contains fields.

If you read the documentation of WWW carefully you will find multiple constructors. There are two that accept a byte array as raw-post data.

Comment
Add comment · Show 2 · Share
10 |3000 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 ina · Aug 30, 2011 at 05:47 AM 0
Share

how do you convert a string or char array to a byte array... i tried string.ToCharArray() - but unity 3.4 has issues taking char arrays as byte arrays "The type 'UnityEngine.WWW' does not have a visible constructor that matches the argument list '(String, char[])'."

avatar image Bunny83 · Aug 30, 2011 at 12:08 PM 0
Share

That might help:

http://www.java2s.com/Code/CSharp/Development-Class/Convertby$$anonymous$$rraytoStringwithBitConverter.htm

googled in less than 5 Sec.

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.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

PHPSESSID with Unity 2 Answers

Sending data to a .php service using Unity's WWW? 1 Answer

Sending cookie to XML-RPC protocol 0 Answers

How do I add a header and a file at the web request at the same time? 0 Answers

PUT with WWWform 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges