ABOUT US PRODUCTS GET INVOLVED BLOG

Ushahidi Mailing Lists

« All Listsdevelopers@list.ushahidi.com

Message: previous - next
Month: July 2013

RE: [ushahidi developers] [TrashSwag] Ushahidi upload issue (windows)

From: Mark MacDonnell <markm@...>
Date: Fri, 5 Jul 2013 18:07:06 +0000
Hi Evan,

We caught that in the code, unfortunately I didn't catch it in this example. Which is funny, as this example was what prompted the initial fix.

-Mark

-----Original Message-----
From: Evan Sims [mailto:evan@...] 
Sent: Friday, 5 July, 2013 13:58
To: developers@...
Subject: Re: [ushahidi developers] [TrashSwag] Ushahidi upload issue (windows)

Hi Mark,

I'm noticing in your POST that you're URL is malformed.

Is: https://trashswag.com/api?task=report?incident_title=test&incident_description=test&incident_category=1&location_name=163%20Upper%20Madison%20Ave,%20North%20York,%20ON%20M2N,%20Canada&latitude=43.764442&longitude=-79.412505&incident_date=06-26-2013&incident_hour=9&incident_minute=46&incident_ampm=am&task=report

Should be: https://trashswag.com/api?task=report&incident_title=test&incident_description=test&incident_category=1&location_name=163%20Upper%20Madison%20Ave,%20North%20York,%20ON%20M2N,%20Canada&latitude=43.764442&longitude=-79.412505&incident_date=06-26-2013&incident_hour=9&incident_minute=46&incident_ampm=am&task=report

--
Evan Sims
Senior Developer, Ushahidi
Crowdmap Team

var signature = {
    "blog": "http://evansims.com",
    "work": {
        "ushahidi": "http://ushahidi.com",
        "crowdmap": "https://crowdmap.com"
    },
    "contact": {
        "gvoice": "tel:+1.217.631.4001",
        "skype": "https://skype.evansims.com"
    },
    "social": {
        "crowdmap": "https://crowdmap.com/user/evansims",
        "twitter": "https://twitter.com/evansims",
        "adn": "https://alpha.app.net/evansims",
        "facebook": "https://facebook.com/evansims",
        "github": "https://github.com/evansims",
        "gplus": "https://google.com/+EvanSims"
    }
};


On Fri, Jul 5, 2013 at 12:48 PM, Mark MacDonnell <markm@...> wrote:
> Hello,

>

>

>

> I’m trying to upload images to an Ushahidi instance (trashswag.com) 

> but it’s not going through. We’re working on the Windows 8 and Windows 

> Phone 8 platforms. Here’s some details:

>

>

>

> This is the POST url:

>

> https://trashswag.com/api?task=report?incident_title=test&incident_des

> cription=test&incident_category=1&location_name=165

> Upper Madison Ave, North York, ON M2N, 

> Canada&latitude=43.764468&longitude=-79.412508&incident_date=06-25-201

> 3&incident_hour=5&incident_minute=30&incident_ampm=pm&task=report

>

>

>

> This is the response message:

>

> {StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content:

> System.Net.Http.StreamContent, Headers:

>

> {

>

> Transfer-Encoding: chunked

>

> Connection: keep-alive

>

> Vary: Accept-Encoding

>

> Pragma: no-cache

>

> Cache-Control: must-revalidate, no-cache

>

> Date: Tue, 25 Jun 2013 21:31:14 GMT

>

> Set-Cookie: ushahidi=f2f7577b55334f2f1cc2653740e6794b; expires=Tue,

> 25-Jun-2013 23:31:14 GMT; path=/; HttpOnly

>

> Set-Cookie: ushahidi=f2f7577b55334f2f1cc2653740e6794b; expires=Tue,

> 25-Jun-2013 23:31:14 GMT; path=/; httponly

>

> Server: nginx

>

> Content-Type: application/json; charset=utf-8

>

> Expires: Sat, 26 Jul 1997 05:00:00 GMT

>

> }}

>

>

>

> And then this is the content of that message:

>

> Id = 1, Status = RanToCompletion, Method = "{null}", Result = 

> "{\"code\":\"001\",\"message\":\"Missing Parameter - task.\"}"

>

>

>

> I guess my question becomes this: Why are we being told task is 

> missing when it's not?

>

>

>

> FIDDLER OUTPUT

>

> Message

>

> POST

> https://trashswag.com/api?task=report?incident_title=test&incident_des

> cription=test&incident_category=1&location_name=163%20Upper%20Madison%

> 20Ave,%20North%20York,%20ON%20M2N,%20Canada&latitude=43.764442&longitu

> de=-79.412505&incident_date=06-26-2013&incident_hour=9&incident_minute

> =46&incident_ampm=am&task=report

> HTTP/1.1

>

> Content-Type: multipart/form-data;

> boundary="04b42fc6-24cd-4163-9110-252c7089c2f6"

>

> Host: trashswag.com

>

> Content-Length: 451858

>

> Expect: 100-continue

>

>

>

> --04b42fc6-24cd-4163-9110-252c7089c2f6

>

> Content-Disposition: form-data; filename="name"; name="photo"

>

> Content-Type: application/octet-stream

>

> Content-Length: 451584

>

> Content-Transfer-Encoding: binary

>

> Content-Encoding: binary

>

>

>

> //Content removed for readability

>

>

>

> --04b42fc6-24cd-4163-9110-252c7089c2f6--

>

>

>

> Response

>

> HTTP/1.1 200 OK

>

> Server: nginx

>

> Date: Wed, 26 Jun 2013 13:46:16 GMT

>

> Content-Type: application/json; charset=utf-8

>

> Connection: keep-alive

>

> Vary: Accept-Encoding

>

> Pragma: no-cache

>

> Cache-Control: no-cache, must-revalidate

>

> Expires: Sat, 26 Jul 1997 05:00:00 GMT

>

> Set-Cookie: ushahidi=a43a13b2c839d526b5d6f886e364af9b; expires=Wed,

> 26-Jun-2013 15:46:16 GMT; path=/; HttpOnly

>

> Set-Cookie: ushahidi=a43a13b2c839d526b5d6f886e364af9b; expires=Wed,

> 26-Jun-2013 15:46:16 GMT; path=/; httponly

>

> Content-Length: 52

>

>

>

> {"code":"001","message":"Missing Parameter - task."}

>

>

>

> Please send me an email if you can help. Any help is greatly appreciated.

>

>

>

> -Mark




~~~~~~~~~~~~~~~~~~~~~~~~~~
List Archive: http://list.ushahidi.com/

Would you like to receive list mail batched in a daily digest instead? Send a message to:
developers-digest-subscribe@...

To remove your address from the list, just send a message to the address in the "List-Unsubscribe" header of any list message. If you haven't changed addresses since subscribing, you can also send a message to:
developers-unsubscribe@...

For addition or removal of addresses, we'll send a confirmation message to that address. When you receive it, simply reply to it to complete the transaction.

If you need to get in touch with the human owner of this list, please send a message to:
developers-owner@...