[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: HTTP API - EXAMPLE8 - HTTP/1.1 500 Internal Server Error



It is probably some small typo someplace. Did you include the debug information? Let's check that. HTTP_DEBUG might be described in EXAMPLE18 in your version otherwise it is in EXAMPLE1 in the beta.

It looks like the curl script is using HTTPS and you posted to HTTP. Try that first.

Looks like Scott beat me to the punch...notice that he included a "special" content-type of application/json.

The tempfile stuff he used in his example creates a temporary file for the output. Look in /tmp for a file name that looks "random".



-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Narasimha Reddy
Sent: Thursday, June 09, 2011 11:08 AM
To: HTTPAPI and FTPAPI Projects
Subject: Re: HTTP API - EXAMPLE8 - HTTP/1.1 500 Internal Server Error

I want to post a file to my vendor link. I used EXAMPLE8 to do this. I have
to change only file name and http link to use it rite !! I am also in touch
with my vendor about this error.

Can you help me if I just want to post stream of data to a given link, which
is the good example I can use as model program ?
*Here is a sample using curl, I would like to do the same from iSeries.*

curl -X POST *
https://events.pagerduty.com/generic/2010-04-15/create_event.json*<https://events.pagerduty.com/generic/2010-04-15/create_event.json>-d
"{ \
'event_type':'trigger', \
'description':'Server www15 running low on memory', \
'service_key': 'e93facc04764012d7bfb002500d5d1a6', \
'incident_key':'frontend-low-free-memory', \
'payload' : { \
'server_name': 'www15', \
'memory_usage': '98%', \
'threshold': 90 \
} \
}"



On Thu, Jun 9, 2011 at 11:28 AM, Mike Krebs <mkrebs@xxxxxxxxxxxxxxxxxx>wrote:

> 500 error comes from the server but is probably caused by what you are
> sending. What does the web page require and what did you post? Look at the
> page that does the post and decipher the parameters.
>
> If you only changed two lines, it probably isn't going to work very well.
>
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:
> ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Narasimha Reddy
> Sent: Thursday, June 09, 2011 10:03 AM
> To: HTTPAPI and FTPAPI Projects
> Subject: HTTP API - EXAMPLE8 - HTTP/1.1 500 Internal Server Error
>
> Hello,
>
> I have copied Example8 program to post the file. But I am getting following
> Error.
> *HTTP/1.1 500 Internal Server Error  *
> Is it Error from the server or from the code I modified ? Can some one
> explain this error ? I am very new to these concepts.
>
> I modified 2 lines Example8 as below:
> eval      stmf = '/home/trigger1.json'
> .
> eval      rc=http_url_post('http://events.pager'+
>              'duty.com/generic/2010-04-15/'+
>              'create_event.json':
>               p_data: st_size:
>               '/httptest.html')
>
> /home/trigger1.json contains following data
> {
>  "service_key": "3397ab606eba012eae1812313d009e57",
>  "incident_key": "HTTPAPI01",
>  "event_type": "trigger",
>  "description": "Testing Trigger from HTTP API by Reddy by Reddy "
> }
> I want to post this data to
> http://events.pagerduty.com/generic/2010-04-15/create_event.json
>
> --
> Narasimha Reddy
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>



-- 
Narasimha Reddy
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------