WWW Obselete Use UnityWebRequest
I did find work arounds on forums for this, but I have a code from this asset that don't understand how to convert.
Hoping someone to help me with this formpost,
public IEnumerator UploadCardRoutine(TrelloCard card)
{
WWWForm post = new WWWForm();
post.AddField("name", card.name);
post.AddField("desc", card.desc);
post.AddField("pos", card.pos);
post.AddField("due", card.due);
post.AddField("idList", card.idList);
WWW www = new WWW(cardBaseUrl + "?" + "key=" + key + "&token=" + token, post);
yield return www;
CheckWwwStatus("Could not upload new card to Trello", www);
var dict = Json.Deserialize(www.text) as Dictionary<string, object>;
yield return (string)dict["id"];
}
Then also
public IEnumerator SetUpAttachmentInCardRoutine(string cardId, string attachmentName, Texture2D image) { // Encode texture into PNG byte[] bytes = image.EncodeToPNG();
// Create a Web Form
WWWForm form = new WWWForm();
form.AddBinaryData("file", bytes, attachmentName, "image/png");
WWW www = new WWW(cardBaseUrl + cardId + "/attachments" + "?" + "key=" + key + "&token=" + token, form);
yield return www;
CheckWwwStatus("Could not upload the attachment to the card", www);
}
public IEnumerator PopulateBoardsRoutine()
{
boards = null;
WWW www = new WWW(memberBaseUrl + "?" + "key=" + key + "&token=" + token + "&boards=all");
yield return www;
CheckWwwStatus("Connection to the Trello servers was not possible", www);
var dict = Json.Deserialize(www.text) as Dictionary<string, object>;
boards = (List<object>)dict["boards"];
}
If you can help me convert this to the new web request, much appreciated. I am trying to clean up the warnings from this asset -> https://assetstore.unity.com/packages/tools/integration/trello-bug-tracker-pro-75613
Thank you
Your answer
![](https://koobas.hobune.stream/wayback/20220612231924im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
WebGL/WebSocket has stopped while processing WWW.LoadFromCacheOrDownload 0 Answers
Get Internet Year PHP 0 Answers
¿HOW TO Open files with SPACES in the NAME? 1 Answer
WWW Error : 404 with working url 1 Answer
Can't get echo 1 Answer