GoSublime icon indicating copy to clipboard operation
GoSublime copied to clipboard

Posting to go playground results in wrong method error

Open jvsteiner opened this issue 6 years ago • 4 comments

When I use the feature to post on the playground, the console shows the following error:

[ `share` | done ]
	Unexpected http status: 405 Method Not Allowed
	http://play.golang.org/p/Requires POST

jvsteiner avatar Dec 20 '18 11:12 jvsteiner

looks like this is not caused by the original request, which is clearly a POST. this is when GoSublime tries to follow the returned link to the shared content - evident by the /p/ in the url. I did some experimenting with curl, and I can post content, but I am not getting the content identifier (the stuff that should be after the /p/ in a correct playground share link in the body returned from the original POST request. dunno if this is a playground api change..

jvsteiner avatar Dec 20 '18 12:12 jvsteiner

I think it's because it uses http:// instead of https://.

All that code is going to be deleted so I ported it to the new version of margo.

With the margo.go file open (ctrl+.,ctrl+x), press ctrl+9 to open 9o and type go get -v contrib.margo.sh/golang/playground.

After that you can use it by adding import "contrib.margo.sh/golang/playground" to the margo.go file and &playground.Share{}, to your list of reducers.

This will add a new 9o command GoPlayground.Share and a ui command (ctrl+.,ctrl+c) with title Share file on play.golang.org.

DisposaBoy avatar Dec 20 '18 18:12 DisposaBoy

@DisposaBoy - Sorry, I'm confused. Will this issue get fixed in an upcoming release of GoSublime?

bminer avatar Jan 09 '19 21:01 bminer

@bminer No, the code will be deleted so the whole share feature will be removed, but the reducer I mention effectively does the same thing.

DisposaBoy avatar Jan 10 '19 20:01 DisposaBoy