functions-framework-java icon indicating copy to clipboard operation
functions-framework-java copied to clipboard

Not able to send xml message to local GCF, how?

Open anborg opened this issue 4 years ago • 1 comments

How do I send an xml payload from file to local GCF? I don't want to base64, copy paste into json etc.

curl -vX POST http://localhost:8080 -H "Content-Type: text/json" -d @testmsg.json

testmsg.json

{
  "context": {
    "eventId":"1144231683168617",
    "timestamp":"2020-05-06T07:33:34.556Z",
    "eventType":"google.pubsub.topic.publish",
    "resource":{
      "service":"pubsub.googleapis.com",
      "name":"projects/sample-project/topics/gcf-test",
      "type":"type.googleapis.com/google.pubsub.v1.PubsubMessage"
    }
  },
  "data": {
    "@type": "type.googleapis.com/google.pubsub.v1.PubsubMessage",
    "attributes": {
    "attr1":"attr1-value"
    },
    "data": "@../ord/myorder.xml"
  }
}

image

anborg avatar Apr 10 '21 00:04 anborg

Does this work? https://stackoverflow.com/questions/3007253/post-xml-file-using-curl-command-line

anniefu avatar Sep 10 '21 22:09 anniefu

This issue has been open for a while without update. If you're still experiencing an issue, please re-open with:

  • What you tried.
  • What you expected to happen.
  • What actually happened instead.

That will help us better understand the root cause of the issue to propose a solution that'll work for you. Thanks!

josephlewis42 avatar Apr 06 '23 19:04 josephlewis42