# How to make a POST request with Tumblr API?

**URL:** <https://forum.kirupa.com/t/how-to-make-a-post-request-with-tumblr-api/304124>\
**Category:** flash\
**Created:** [February 2, 2010, 5:24am UTC](https://forum.kirupa.com/t/how-to-make-a-post-request-with-tumblr-api/304124 "2010-02-02T05:24:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blkdimund](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@blkdimund](https://forum.kirupa.com/u/blkdimund)\
**Post date:** [February 2, 2010, 5:24am UTC](https://forum.kirupa.com/t/how-to-make-a-post-request-with-tumblr-api/304124/1 "2010-02-02T05:24:41Z")

</div>

So I’m trying to code an AIR widget for Tumblr. Before I actually start working on the widget, I wanted to play around with AS3 and the Tumblr API to do simple things, like reading and writing posts, editing posts etc. I got reading posts working, but when it comes to creating posts I run into an unknown brickwall.

Here’s the instructions from Tumblr’s API doc on making a POST request:

> The Write API is a very simple HTTP interface. To create a post, send a POST request to [http://www.tumblr.com/api/write](http://www.tumblr.com/api/write) with the following parameters:

email - Your account’s email address.  
password - Your account’s password.  
type - The post type.

These are the valid values for the type parameter, with the associated content parameters that each type supports:

regular - Requires at least one:  
title  
body (HTML allowed)

> **[API | Tumblr](https://www.tumblr.com/docs/en/api/v2)**
>
> Tumblr is a place to express yourself, discover yourself, and bond over the stuff you love. It's where your interests connect you with your people.

And here’s my AS3 code:

```auto
import flash.net.*

gogo.buttonMode = true; // gogo is the instance name of a MC on the stage
gogo.addEventListener(MouseEvent.MOUSE_DOWN, go);

function go(e:MouseEvent):void{
	var variables:URLVariables = new URLVariables();
	variables.email = "myemail@gmail.com";
	variables.password = "mypassword";
	variables.type = "regular"; // this is the post type
	variables.body = "body"; // this is the body of the post
	variables.group = "airtest.tumblr.com"; // this is my secondary blog that i want to post to //
	
	
	var request:URLRequest = new URLRequest("http://www.tumblr.com/api/write");
	request.method = URLRequestMethod.POST;
	request.data = variables;
}

```

And for the life of me, no matter how simple I make this code, I cannot get it to work.

What am I doing wrong?
