Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Sending xml through post

I just cant seem to get the right request for this http://myanimelist.net/modules.php?go=api#updateanime

Please can someone help me out and I have searched google and cannot find an answer.
Send the parameters user and password. That's to make sure you're authenticated. Or am I missing something here?

Oh and you need to specify how you're sending the data.

Like for XML you send this in:

Code
<?xml version="1.0" encoding="UTF-8"?>
<entry>
    <episode>11</episode>
    <status>1</status>
    <score>7</score>
    <downloaded_episodes></downloaded_episodes>
    <storage_type></storage_type>
    <storage_value></storage_value>
    <times_rewatched></times_rewatched>
    <rewatch_value></rewatch_value>
    <date_start></date_start>
    <date_finish></date_finish>
    <priority></priority>
    <enable_discussion></enable_discussion>
    <enable_rewatching></enable_rewatching>
    <comments></comments>
    <fansub_group></fansub_group>
    <tags>test tag, 2nd tag</tags>
</entry>
[Image: wOdD4yf.gif]
(Aug 12, 2014 03:14 PM)Pillows Wrote:  Send the parameters user and password. That's to make sure you're authenticated. Or am I missing something here?

Oh and you need to specify how you're sending the data.

Like for XML you send this in:

Code
<?xml version="1.0" encoding="UTF-8"?>
<entry>
    <episode>11</episode>
    <status>1</status>
    <score>7</score>
    <downloaded_episodes></downloaded_episodes>
    <storage_type></storage_type>
    <storage_value></storage_value>
    <times_rewatched></times_rewatched>
    <rewatch_value></rewatch_value>
    <date_start></date_start>
    <date_finish></date_finish>
    <priority></priority>
    <enable_discussion></enable_discussion>
    <enable_rewatching></enable_rewatching>
    <comments></comments>
    <fansub_group></fansub_group>
    <tags>test tag, 2nd tag</tags>
</entry>

I've worked it out. The MAL API documentation is very misleading. It doesn't want an xml request it just wants a normal post request with data="xml".

Nevermind again. I use "postman" for chrome to send it and it works. I try to send it in c# and 501 not implemented.
(Aug 12, 2014 03:18 PM)Angel Beats‌‌ Wrote:  I've worked it out. The MAL API documentation is very misleading. It doesn't want an xml request it just wants a normal post request with data="xml".

Nevermind again. I use "postman" for chrome to send it and it works. I try to send it in c# and 501 not implemented.

Have you tried making headers in your request to make it look like a browser?
[Image: wOdD4yf.gif]
(Aug 12, 2014 04:04 PM)Pillows Wrote:  Have you tried making headers in your request to make it look like a browser?

Yep I have tried to mimic the exact same request and as far as I can see its the same.
i do it when i want to send req to online-convert.com which require xml here how i do it maybe it will help u
Xml = "<queue><apiKey>...</apiKey><targetType>image</targetType><testMode>true</testMode></queue>"
req post http://api.online-convert.com/get-queue?queue= & Xml


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Ownc0d3rAug 12, 2018 07:03 AM 3 156 Aug 12, 2018 07:03 AM
Last Post: TyrantKingBen
[Python] by SIM-1534439May 21, 2017 07:12 AM 4 189 May 21, 2017 07:12 AM
Last Post: Charger
[.NET] by offpageseoAug 25, 2016 08:49 AM 3 137 Aug 25, 2016 08:49 AM
Last Post: Elitas