Giter Club home page Giter Club logo

Comments (2)

wavded avatar wavded commented on August 18, 2024 1

This looks like the python requests library. According the documentation, it seems like passing targetSrs as a file with text may be the issue. Should that use the data parameter for that part? Multer expects only one file named upload and guards against other files being sent. It seems like the multipart request may be labelling targetSrs as a file here.

Caveat, I know very little about python requests library and may be totally wrong here! If that doesn't work, are you able to send the raw request to me? Note this isn't an issue using the web UI and the way the browser is formatting a multipart request.

from ogre.

scmj avatar scmj commented on August 18, 2024 1

You were absolutely right, it was a python requests library issue. I separated the request in two as shown below, and it worked. I was so fixated on Multer that I overlooked the obvious mistake I made. Thank you very much!

url= https://localhost:3000/convert

gmlfile = ('test.gml')

payload = {"upload":('test.gml' , open(gmlfile, "rb"))}

values = {"targetSrs":"EPSG:4326"}

response = requests.post(url, files=payload, data=values)

file_name = 'result.json'

with open(file_name,'w') as f:
  f.write(response.text)
  f.close()

from ogre.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.