Set a GPS property via API for Olympus Air - gps

I am trying to add GPS tag to each photo using the Olympus Air and the API.
But i can't even set the GPS on.( I am on record mode ) The camera is not responding to the command.
I tried a POST with:
http://192.168.0.10/set_camprop.cgi?com=setlist
Headers
Content-type: text/xml
User-Agent: OlympusCameraKit
Content-Length: 74
Host: 192.168.0.10
Connection: Keep-Alive
Body
<?xml version="1.0"?><set><prop name="GPS"><value>ON</value></prop>
</set>

My shell script works correctly on macOS.
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/get_connectmode.cgi'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/switch_commpath.cgi?path=wifi'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/start_pushevent.cgi?port=65000'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/switch_cameramode.cgi?mode=standalone'
sleep 2
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/switch_cameramode.cgi?mode=rec&lvqt=0320x0240'
sleep 2
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/exec_takemisc.cgi?com=startliveview&port=5555'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/get_state.cgi'
echo
echo
curl -v \
-H 'Content-type: text/xml' \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
-d '<?xml version="1.0"?><set><prop name="GPS"><value>ON</value></prop></set>' \
'http://192.168.0.10/set_camprop.cgi?com=setlist'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/get_camprop.cgi?com=get&propname=GPS'
echo
echo
curl -v \
-H 'User-Agent: OlympusCameraKit' \
-H 'Host: 192.168.0.10' \
'http://192.168.0.10/switch_cameramode.cgi?mode=standalone'
sleep 2
echo
echo
A result is following:
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /get_connectmode.cgi HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 55
< Connection: close
<
<?xml version="1.0"?>
<connectmode>OPC</connectmode>
* Curl_http_done: called premature == 0
* Closing connection 0
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_commpath.cgi?path=wifi HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Length: 0
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /start_pushevent.cgi?port=65000 HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: www/unknown
< Content-Length: 0
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_cameramode.cgi?mode=standalone HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 40
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><result>OK</result>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_cameramode.cgi?mode=rec&lvqt=0320x0240 HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 40
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><result>OK</result>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /exec_takemisc.cgi?com=startliveview&port=5555 HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 405
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><funcidlist><funcid name="framesize"/><funcid name="afframeinfo"/><funcid name="mntmediainfo"/><funcid name="rotation"/><funcid name="maxtakenum"/><funcid name="shutspeedvalue"/><funcid name="focalvalue"/><funcid name="expcomp"/><funcid name="isospeedvalue"/><funcid name="expphotowarning"/><funcid name="focusinfo"/><funcid name="zoominfo"/><funcid name="maxmovietime"/></funcidlist>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /get_state.cgi HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 426
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><response><cardstatus>normal</cardstatus><cardremainnum>425</cardremainnum><cardremainsec>1123</cardremainsec><cardremainbyte>3709501440</cardremainbyte><lensmountstatus>normal</lensmountstatus><imagingstate>normal</imagingstate><focallength>14</focallength><widefocallength>14</widefocallength><telefocallength>42</telefocallength><electriczoom>OK</electriczoom><macrosetting>NG</macrosetting></response>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> POST /set_camprop.cgi?com=setlist HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> Content-type: text/xml
> User-Agent: OlympusCameraKit
> Content-Length: 73
>
* upload completely sent off: 73 out of 73 bytes
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 59
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><response><notset></notset></response>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /get_camprop.cgi?com=get&propname=GPS HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 49
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><get><value>ON</value></get>
* Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_cameramode.cgi?mode=standalone HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
>
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 40
< Connection: close
<
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><result>OK</result>
I hope it will help you.

Related

How to override Kong Gateway default certificates in Kubernetes

I'm trying to set up an SSL certificate for Kong 2.7 installed in Kubernetes but I am not getting this to work as expected. I tried to follow this guide. Even looking for additional help in discussion .
curl -X POST http://kong-admin:8001/certificates -F "cert=kong.lan.pem" -F "key=kong.lan.key" -F "snis[0]=mydomain.net"
This is my response:
{
"fields": {
"cert": "invalid certificate: x509.new: asn1/a_d2i_fp.c:197:error:0D06B08E:asn1 encoding routines:asn1_d2i_read_bio:not enough data",
"key": "invalid key: pkey.new:load_key: asn1/a_d2i_fp.c:197:error:0D06B08E:asn1 encoding routines:asn1_d2i_read_bio:not enough data"
},
"message": "2 schema violations (cert: invalid certificate: x509.new: asn1/a_d2i_fp.c:197:error:0D06B08E:asn1 encoding routines:asn1_d2i_read_bio:not enough data; key: invalid key: pkey.new:load_key: asn1/a_d2i_fp.c:197:error:0D06B08E:asn1 encoding routines:asn1_d2i_read_bio:not enough data)",
"name": "schema violation",
"code": 2
}
Kong deployed with helm chart:
$ helm repo add kong https://charts.konghq.com
$ helm repo update
$ helm install kong/kong --generate-name --set ingressController.enabled=true --set admin.enabled=True --set admin.http.enabled=True --set ingress.enabled=True --set proxy.ingress.enabled=True --set admin.type=LoadBalancer --set proxy.type=LoadBalancer
Does any of you know how to make this working or how to add tls.crt and tls.key into Kong Deployment?
You just miss the # on the curl command to upload files
curl -X POST http://kong-admin:8001/certificates -F "cert=#kong.lan.pem" -F "key=#kong.lan.key" -F "snis[0]=mydomain.net"
curl -X POST http://localhost:8001/certificates -F "cert=kong.lan.pem" -F "key=kong.lan.key" -F "snis[0]=mydomain.net"
will send
POST /certificates HTTP/1.1
Host: localhost:8001
User-Agent: curl/7.68.0
Accept: */*
Content-Length: 363
Content-Type: multipart/form-data; boundary=------------------------d67ae21b533e5746
--------------------------d67ae21b533e5746
Content-Disposition: form-data; name="cert"
kong.lan.pem
--------------------------d67ae21b533e5746
Content-Disposition: form-data; name="key"
kong.lan.key
--------------------------d67ae21b533e5746
Content-Disposition: form-data; name="snis[0]"
mydomain.net
--------------------------d67ae21b533e5746--
echo "toto" >| kong.lan.pem
curl -X POST http://localhost:8001/certificates -F "cert=#kong.lan.pem" -F "key=kong.lan.key" -F "snis[0]=mydomain.net"
will send
POST /certificates HTTP/1.1
Host: localhost:8001
User-Agent: curl/7.68.0
Accept: */*
Content-Length: 421
Content-Type: multipart/form-data; boundary=------------------------973b3467e461334a
--------------------------973b3467e461334a
Content-Disposition: form-data; name="cert"; filename="kong.lan.pem"
Content-Type: application/octet-stream
toto
--------------------------973b3467e461334a
Content-Disposition: form-data; name="key"
kong.lan.key
--------------------------973b3467e461334a
Content-Disposition: form-data; name="snis[0]"
mydomain.net
--------------------------973b3467e461334a--

my request failed when the post 'content-type' is application/x-www-form-urlencoded and * form field param= { <this is a json object>}

The request is failed when I post request an API whose header content-type is 'application/x-www-form-urlencoded; charset=UTF-8' and post body is ' param = { this is a json object} '
The curl request like this, it works.
curl 'http://localhost:7272/Acme/iEhr/PersonSample' -H 'Cookie: ACMETMP=fe35925f-a243-4be9-8e73-60c461ef9bd3; JSESSIONID=47A43F4988F232CC7B53F6CF30B954F6; SESSION=e580c2c7-bf4b-45e6-93fc-de6f79854346' -H 'Origin: http://localhost:7272' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: zh-CN,zh;q=0.9' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, /; q=0.01' -H 'Referer: http://localhost:7272/route/sampleadd' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'param=%7B%22cityid%22%3A%222091afc3-bcd6-46d9-8033-3548ad10933b%22%2C%22areaid%22%3A%222d09f5e5-a07d-445c-9d8a-51eb436699a8%22%2C%22hosid%22%3A%220f226b63-58ad-44d7-bf23-25d0345276e1%22%2C%22deptid%22%3A%2291c176f5-63ca-4b95-87c4-9f311864ff9b%22%2C%22barcode%22%3A%221000000000%22%2C ......' --compressed
it also works with postman request but failed with Karate
Scenario: 样本登记
Given path 'iEhr/PersonSample'
And header Content-type = 'application/x-www-form-urlencoded; charset=UTF-8'
* cookies { JSESSIONID: '#(jsessionID)',SESSION: '#(sessionID)', ACMETMP: '#(acmetmpID)'}
And form fields param = {"cityid":"2091afc3-bcd6-46d9-8033-3548ad10933b","areaid":"2d09f5e5-a07d-445c-9d8a-51eb436699a8","hosid":"0f226b63-58ad-44d7-bf23-25d0345276e1","deptid":"91c176f5-63ca-4b95-87c4-9f311864ff9b","barcode":"1000000000","mothername":"manual-mother1","pregweek":"21", and so on}
When method post
Then status 200
* print response
'And form fields param = {this is a json object}'
this sentence should work but failed for us.
What is my means by karate failed ?
The response code is different compared with Karate, and it is expected result when working with postman.
Postman
the necessary param data
Karate:
18:14:09.437 request:
1 > POST http://localhost:7272/Acme/iEhr/PersonSample
1 > Accept-Encoding: gzip,deflate
1 > Connection: Keep-Alive
1 > Content-Length: 899
1 > Content-Type: application/x-www-form-urlencoded; charset=UTF-8
1 > Cookie: ACMETMP=d22c0d9a-b98b-4f6f-9e42-2f9bdffa22c8; JSESSIONID=09268B9F4CA0C15AE3FFB1A26BE424ED; SESSION=2baafdac-38d6-43d0-ac5c-d39e2b29fa48
1 > Host: localhost:7272
1 > User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_211)
cityid=2091afc3-bcd6-46d9-8033-3548ad10933b&areaid=2d09f5e5-a07d-445c-9d8a-51eb436699a8&hosid=0f226b63-58ad-44d7-bf23-25d0345276e1&deptid=91c176f5-63ca-4b95-87c4-9f311864ff9b&barcode=1000000000&mothername=manual-mother1&pregweek=21&pregday=1&midentitycard=&birthday=2018-10-01+00%3A00&collectdate=2019-05-15+14%3A38&personsex=1&personweight=4000&address=manual-testaddress1&mobile=15397006044&collectperson=&samplequality=1&borntype=1&linkman=&fidentitycard=&labitem=PHE&sampletype=1&btn=&isfee=0&personremark=&telephone=&bednumber=&labstring=&collectnumber=&freecode=&dhosid=0f226b63-58ad-44d7-bf23-25d0345276e1&reviewtype=&diagnosticstatus=&centerid=bb717701-10de-47ee-b49e-693261c6df22&nowdeptid=07eeec75-079b-4fa9-93cf-c45ddc9a87b9&operator=%E9%BB%84%E5%86%88%E5%B8%82%E5%A6%87%E5%B9%BC%E4%BF%9D%E5%81%A5%E9%99%A2&labitems=PHE&pagecode=sampleadd&modifydetail=%E6%A0%B7%E6%9C%AC%E5%BD%95%E5%85%A5
18:14:09.557 response time in milliseconds: 120.12
1 < 200
1 < Accept-Charset: big5, big5-hkscs, cesu-8, euc-jp, euc-kr, gb18030, gb2312, gbk, ibm-thai ...... and so on
1 < Content-Length: 52
1 < Content-Type: text/plain;charset=UTF-8
1 < Date: Wed, 15 May 2019 10:14:09 GMT
1 < X-Application-Context: Acme.jc.test:dev:7272
[{"code":-90018,"result":"(错误-90018)失败!"}]
Can you try this,
Scenario: 样本登记
Given path 'iEhr/PersonSample'
* cookies { JSESSIONID: '#(jsessionID)',SESSION: '#(sessionID)', ACMETMP: '#(acmetmpID)'}
And def ffParams = {"param" : {"cityid":"2091afc3-bcd6-46d9-8033-3548ad10933b","areaid":"2d09f5e5-a07d-445c-9d8a-51eb436699a8","hosid":"0f226b63-58ad-44d7-bf23-25d0345276e1","deptid":"91c176f5-63ca-4b95-87c4-9f311864ff9b","barcode":"1000000000","mothername":"manual-mother1","pregweek":"21"}}
And form fields ffParams
When method post
Then status 200
* print response
Form fields are by default url-encoded only no need to explicitly mention it in header
And form field param = {"cityid":"2091afc3-bcd6-46d9-8033-3548ad10933b","areaid":"2d09f5e5-a07d-445c-9d8a-51eb436699a8","hosid":"0f226b63-58ad-44d7-bf23-25d0345276e1","deptid":"91c176f5-63ca-4b95-87c4-9f311864ff9b","barcode":"1000000000","mothername":"manual-mother1","pregweek":"21","pregday":"1","midentitycard":"","birthday":"2018-10-01 00:00" ...... and so on }
I changed to this, it works now.
I am misled by the keyword 'param' in karate and the keyword 'param' used by our product code.

Why POST endpoint not being invoked but GET endpoint is being invoked - jersey container grizzly2

I can't figure out why my GET endpoint gets called but my POST endpoint is not working. When I call curl -v -X GET http://localhost:8080/myresource/test123 it succesfully returns hello
But when I call
curl -v -X POST \
http://localhost:8080/myresource \
-H 'Content-Type: application/json' \
-d '{"test": "testvalue"}'
I keep getting this response:
* Connected to localhost (::1) port 8080 (#0)
> POST /myresource HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 21
>
* upload completely sent off: 21 out of 21 bytes
< HTTP/1.1 500 Request failed.
< Content-Type: text/html;charset=ISO-8859-1
< Connection: close
< Content-Length: 1031
<
* Closing connection 0
<html><head><title>Grizzly 2.4.0</title><style><!--div.header {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#003300;font-size:22px;-moz-border-radius-topleft: 10px;border-top-left-radius: 10px;-moz-border-radius-topright: 10px;border-top-right-radius: 10px;padding-left: 5px}div.body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:#FFFFCC;font-size:16px;padding-top:10px;padding-bottom:10px;padding-left:10px}div.footer {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#666633;font-size:14px;-moz-border-radius-bottomleft: 10px;border-bottom-left-radius: 10px;-moz-border-radius-bottomright: 10px;border-bottom-right-radius: 10px;padding-left: 5px}BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}B {font-family:Tahoma,Arial,sans-serif;color:black;}A {color : black;}HR {color : #999966;}--></style> </head><body><div class="header">Request failed.</div><div class="body">Request failed.</div><div class="footer">Grizzly 2.4.0</div></body></html>%
Here is my code
import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.ws.rs.core.Response
#Path("myresource")
class HelloWorldResource {
#POST
#Consumes(MediaType.APPLICATION_JSON)
#Produces(MediaType.APPLICATION_JSON)
fun createMessage(testPost: String): Response {
return Response.status(200).entity("helllo post").build()
}
#GET
#Path("{testGet}")
#Produces(MediaType.APPLICATION_JSON)
fun getMessage(#PathParam("testGet") testGet: String): Response {
return Response.status(200).entity("hello").build()
}
}
Without seeing the actual underlying exception, it's hard to say for sure, but likely you're running into similar issues as Jersey: Return a list of strings with mismatches between a String type and a MediaType.APPLICATION_JSON produces/consumes declarations. If you're dealing in raw strings, I'd suggest using MediaType.PLAIN_TEXT, or having your post body and return value be an entity that can be represented as a non-raw-string json object (ie, something enclosed in {}), and making sure a jackson provider is registered with jersey.

Reading an ActiveMQ Topic using cURL - Getting message bodies

I'm trying to debug some JMS code by running an ActiveMQ locally - Using the Docker image rmohr/activemq:5.15.4-alpine - and using cURL to read the messages posted to the topic. This is mostly working, but I'm not getting the actual body of the message.
What I'm doing is:
curl -v -XGET http://admin:admin#localhost:8161/api/message?destination=topic://Events&json=true&oneShot=true
And this works as follows:
> GET /api/message?destination=topic://Events&json=true&oneShot=true HTTP/1.1
> Host: localhost:8161
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 20 Nov 2018 17:09:03 GMT
< X-FRAME-OPTIONS: SAMEORIGIN
< Set-Cookie: JSESSIONID=mcjaka6dsuz6534j0gj0gfnv;Path=/api
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Cache-Control: no-cache, no-store, must-revalidate
< Pragma: no-cache
< Content-Type: application/x-www-form-urlencoded; charset=ISO-8859-1
< destination: topic://Events
< id: ID:b8b750274409-46243-1542707161912-1:23:1:1:6
< eventTime$iso8601: 2018-11-20T17:09:13.216Z
< eventTime$millis: 1542733753216
< eventName: ProcessItemEvent
< Transfer-Encoding: chunked
< Server: Jetty(9.2.22.v20170606)
<
However, the actual payload of the message is not returned. If I take off the json=true&oneShot=true then I get this instead:
{ [5 bytes data]
But still no more than that. And there should be a lot more than 5 bytes of payload data for these messages.
What am I missing in getting these messages to come through correctly?
Cheers
You are subscribing to topic://Events . Could it be that all the event information is in the header of the http response, and ActiveMQ is not adding anything extra in the body?
< destination: topic://Events
< id: ID:b8b750274409-46243-1542707161912-1:23:1:1:6
< eventTime$iso8601: 2018-11-20T17:09:13.216Z
< eventTime$millis: 1542733753216
< eventName: ProcessItemEven
If you want the messages posted to a specific topic, say 'foo.bar' you need to subscribe to topic://foo.bar .
I tried your command. As you can see below, I am getting the message body.
Could it be that you are receiving binary data that is not displaying in the terminal? Can you try saving the message body to a file. e.g. curl -o body.dat -v -XGET ...
$ curl -v -XGET 'http://admin:admin#localhost:8161/api/message?destination=topic://bayCarrState'
> GET /api/message?destination=topic://bayCarrState HTTP/1.1
> Authorization: Basic YWRtaW46YnJva2VyYWRtaW4=
> User-Agent: curl/7.29.0
> Host: localhost:8161
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Fri, 23 Nov 2018 04:55:59 GMT
< X-FRAME-OPTIONS: SAMEORIGIN
< Set-Cookie: JSESSIONID=sbwv48hmp5w9zw4zgttrbmyn;Path=/api
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Cache-Control: no-cache, no-store, must-revalidate
< Pragma: no-cache
< Content-Type: text/plain; charset=ISO-8859-1
< destination: topic://bayCarrState
< id: ID:prd-rh7.mirrabooka.local-40596-1541746708502-3:160:-1:1:105
< Transfer-Encoding: chunked
< Server: Jetty(9.2.22.v20170606)
<
[{"elemId":"BayCarrState1","elemType":"BayCarrState","elemValue":{"bayId":"1","binFullWt":0,"binTipng":0,"binUntipdWt":0,"continuableRailSam
":0,"delivType":"R","frontPos":14,"lastSamTipng":0,"lastTickTipng":0,"locNum":1,"milltrainId":"A","rearPos":1,"samInProgress":0,"samTipng":0
,"tickTipng":0,"tipInProgress":0,"tipReady":0},"version":294},{"elemId":"BayCarrState2","elemType":"BayCarrState","elemValue":{"bayId":"2","
binFullWt":0,"binTipng":0,"binUntipdWt":0,"continuableRailSam":0,"delivType":"T","frontPos":28,"lastSamTipng":0,"lastTickTipng":0,"locNum":1
,"milltrainId":"A","rearPos":15,"samInProgress":0,"samTipng":0,"tickTipng":0,"tipInProgress":0,"tipReady":0},"version":294}]
* Connection #0 to host localhost left intact

Linkedin Share Api using simple curl

I do a simple request to share something on my linkedin profile
I try to just do it with curl but it doesn't work
I set the content-type to JSON in the header and I also set the authorization in the header
curl -v -H 'Authorization: OAuth oauth_consumer_key="V9uKPtEEB7JxQvYzbR2DuDfLe4qXjASgP5UhPJp8k13CYgSnN3BRFILxUJ6ApuCH",oauth_token="d6af5cda-b46e-4c38-b566-11428a9584fc",oauth_signature_method="HMAC-SHA1",oauth_signature="1PofnBExFc7pMB8b08fV34B5sTg%3D",oauth_timestamp="1323544645",oauth_nonce="516e0a1eadda4c24bfbcc4ca5e0cbedc",oauth_version="1.0"' -H 'Content-Type: application/json' -X POST -d '{"recipients":{"values": [{"person":{"_path": "/people/~"}}]}, "subject": "JSON POST test", "body": "You rule"}' http://api.linkedin.com/v1/people/~/shares
When I post this I get this result
About to connect() to api.linkedin.com port 80 (#0)
* Trying 216.52.242.83... connected
* Connected to api.linkedin.com (216.52.242.83) port 80 (#0)
> POST /v1/people/ICshCGDT79/shares HTTP/1.1
> User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: api.linkedin.com
> Accept: */*
> Authorization: OAuth oauth_consumer_key="V9uKPtEEB7JxQvYzbR2DuDfLe4qXjASgP5UhPJp8k13CYgSnN3BRFILxUJ6ApuCH",oauth_token="d6af5cda-b46e-4c38-b566-11428a9584fc",oauth_signature_method="HMAC-SHA1",oauth_signature="1PofnBExFc7pMB8b08fV34B5sTg%3D",oauth_timestamp="1323544645",oauth_nonce="516e0a1eadda4c24bfbcc4ca5e0cbedc",oauth_version="1.0"
> Content-Type: application/json
> Content-Length: 120
>
< HTTP/1.1 401 Unauthorized
< Server: Apache-Coyote/1.1
< Date: Sat, 10 Dec 2011 19:17:14 GMT
< Vary: *
< x-li-format: xml
< Content-Type: text/xml;charset=UTF-8
< Content-Length: 393
<
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<status>401</status>
<timestamp>1323544635447</timestamp>
<request-id>9UR4KT2T5Z</request-id>
<error-code>0</error-code>
<message>[unauthorized]. OAU:V9uKPtEEB7JxQvYzbR2DuDfLe4qXjASgP5UhPJp8k13CYgSnN3BRFILxUJ6ApuCH|d6af5cda-b46e-4c38-b566-11428a9584fc|*01|*01:1323544645:1PofnBExFc7pMB8b08fV34B5sTg=</message>
</error>
* Connection #0 to host api.linkedin.com left intact
* Closing connection #0
Anyone can tell me where am I wrong?
Thanks,