Traveller Store CotI Features New Posts Mark Forums Read Register


Go Back TravellerRPG.com > Citizens of the Imperium > General Traveller Discussions > Software Solutions

Software Solutions Discussions on Traveller related software.

Reply
 
Thread Tools Display Modes
  #1  
Old August 22nd, 2018, 07:16 PM
agorski's Avatar
agorski agorski is offline
Citizen: SOC-13
 
Join Date: Sep 2010
Location: Prescott AZ
Posts: 678
Gallery : 4
agorski Citizen+agorski Citizen+
Default How to access the Travellermap API

I've been fighting this one for awhile and finally got it to work in the iPad app I'm working on that creates sectors and uses the API to draw them in the app.

This particular example requests a subsector map, and returns an image (png, I believe).

However you generate this, something like this is what you want to send to the Poster API. Your headers will vary. See the docs at:

https://travellermap.com/doc/API#pos...t-or-subsector

"file" is the sector data in one of the valid text formats.
"metadata" is the sector metadata in (in my case) XML format.
Line endings everywhere are CRLF.

I discovered that the "filename" fields, although not used, are required. The Content-Type declaration for each part is also required.

Code:
POST /api/poster?subsector=A&scale=72&style=poster&options=25595&sscords=1 HTTP/1.1
Host: travellermap.com
Content-Type: multipart/form-data; boundary= IMTUStrephonLives
Connection: keep-alive
Accept: */*
User-Agent: SectorMaker.debug/1.0.0 CFNetwork/901.1 Darwin/17.7.0
Accept-Language: en-us
Accept-Encoding: br, gzip, deflate
Content-Length: 2288

--IMTUStrephonLives
Content-Disposition: form-data; name="file"; filename="sectordata.txt"
Content-Type: text/plain

contents of sectordata.text

--IMTUStrephonLives
Content-Disposition: form-data; name="metadata"; filename="sectormetadata.txt"
Content-Type: text/plain

contents of sectormetadata.text

--IMTUStrephonLives--
__________________
Mac & iOS software for Traveller: http://naasirka.weebly.com/
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moot Access nickgark Citizens' Information Centre 2 April 17th, 2018 07:43 PM
Moot access? SirKerry Citizens' Information Centre 1 February 7th, 2018 06:03 AM
Moot access for me, too OjnoTheRed Citizens' Information Centre 3 September 17th, 2011 07:20 AM

This website and its contents are copyright ©2010- Far Future Enterprises. All rights reserved. Traveller is a registered trademark of Far Future Enterprises .
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (c) 2010-2013, Far Future Enterprises. All Rights Reserved.